I'd like to create a grid based on criteria relating to a primary table,
and a table that references that primary table. Slightly modifying the
example from the web2py docs, let's say the primary table is 't_person',
and it's referenced by the table, 't_thing'. I'd like the grid to list
't_person' entries that are referenced by a 't_thing' entry with a value
'table' for the 'name' field, and by a 't_thing' entry with value 'chair'
for the name field (that is, entries that meet both criteria, not one or
the other).
db.define_table('t_person', Field('first_name'), Field('last_name'), format=
'%(first_name)s')
db.define_table('t_thing', Field('name'),
Field('owner_id', 'reference person'),
format='%(name)s')
fields = [db.t_person.first_name, db.t_person.first_name]
grid = SQLFORM.grid( query, fields = fields, ...)
What's the best way to get the grid to show 't_person' rows that are
referenced by a 't_thing' entry which has the value 'chair' for the 'name'
field AND is referenced by a 't_thing' entry which has the value 'table'
for the 'name' field? Thank you
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.