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/tablename>rips
> http://app/default/show/p <http://app/default/show/tablename>ersons
>

*So a little change on the code I proposed.*

def show():
    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/show/ <http://myapp/default/sections/><tablename>

Reply via email to