I have a support table with the field 'isactive', which is a boolean.  When 
someone is adding to a table that is supported by the first table, I want 
only items with isactive as True to be included in the dropdown.  Here is 
some simplified example code:

model
--------------------------
db.define_table('fruits',
    Field('name', requires = IS_NOT_EMPTY()),
    Field('isactive', 'boolean'))

db.define_table('grocery',
    Field(fruits', db.fruits, requires = IS_EMPTY_OR(IS_IN_DB(db, 
db.fruits, '%(name)s')), represent=lambda id, row: db.fruits(id).name if id 
else ''))
---------------------------

In a SQLFORM generated from the grocery table, how can I only show fruits 
that are active?

Thanks!
-Joe Peacock

-- 



Reply via email to