> def list_records(): > table = request.args(0) > query = request.vars.query > records = db(query).select(db[table]) > return dict(records=records,table=table,query=query)
the fourth line passes a string to the db instance call that expects a query object as those created with this statement: q = db.mytable.myfield.id == <number> Maybe you can do new_query = eval(q) to create the normal db call input. The admin interface does something similar (i don't know if it uses eval) as it processes queries sent by browser user input.