you are looking for something along these lines:

def test():
    rows = db(db['mytable']['fb'] == 'something')
    return dict(rows=rows)

On Apr 29, 10:55 am, Jose <[email protected]> wrote:
> Hi,
>
> Given the following model:
>
> db.define_table('mytable',
>     Field('fa'),
>     Field('fb'),
>     Field('fc'),
> )
>
> I can do:
>
> def test():
>     # get mytable object (type Table) given the name of the table
> (str)
>     mytable = db['mytable']
>
>     # get a_field object (type Field) given the name of the field
> (str)
>     a_field = mytable['fb']
>
>     return dict(mytable=mytable, a_field=a_field)
>
> What I do is with these two objects (mytable, a_field) build a query
>
> def test():
>     mytable = db['mytable']
>     a_field = mytable['fb']
>     rows = db(mytable.a_field == 'something')
>
>     return dict(rows=rows)
>
> But this is not possible.
> Specifically, how you can build a similar query by giving the table
> name and the field name (as string)?
>
> Jose

Reply via email to