[web2py] Re: DRY conception

2011-01-18 Thread Massimo Di Pierro
from a coding point of view tablename=request.controller rows = db(db[tablename]).select() return dict(rows=rows) but the problem is that you have two controllers. Perhaps you should have only one. On Jan 18, 2:59 pm, walter wdv...@gmail.com wrote: I have two controllers which differ only a

[web2py] Re: DRY conception

2011-01-18 Thread walter
but the problem is that you have two controllers. Perhaps you should have only one. I have thought about it. Unfortunately, I need sometimes show all our customers but at the next time I need view all them trips. I would be glad to do merge two controllers into the one. But I cannot figure out

Re: [web2py] Re: DRY conception

2011-01-18 Thread Bruno Rocha
def sections(): allowedtables = ['table1','table2'] tablename = request.args(0) if tablename in allowedtables: rows = db(db[tablename]).select() else: rows = 'You can't access this table' return dict(rows=rows) http://myapp/default/sections/tablename Is

Re: [web2py] Re: DRY conception

2011-01-18 Thread Jonathan Lundell
On Jan 18, 2011, at 1:59 PM, walter wrote: but the problem is that you have two controllers. Perhaps you should have only one. I have thought about it. Unfortunately, I need sometimes show all our customers but at the next time I need view all them trips. I would be glad to do merge two

Re: [web2py] Re: DRY conception

2011-01-18 Thread pbreit
For starters, I wouldn't get so hung up on DRY. Are the pages you are creating very nearly identical but with different data sets? Jonathan's suggestion sounds good: http://app/default/show/t http://app/default/show/tablenamerips http://app/default/show/p http://app/default/show/tablenameersons

Re: [web2py] Re: DRY conception

2011-01-18 Thread Bruno Rocha
2011/1/19 pbreit pbreitenb...@gmail.com For starters, I wouldn't get so hung up on DRY. Are the pages you are creating very nearly identical but with different data sets? Jonathan's suggestion sounds good: http://app/default/show/t http://app/default/show/tablenamerips