I defined the following table:

db.define_table('nav',
    Field('name',length=32),
    ...
    Field('parentID','reference 
nav',requires=IS_IN_DB(db,'nav.id','%(name)s',zero=T('select a value'))))

In the form I'd like to have a drop box which only contains the navs that 
have a parentID==0

I guess the following comes close to what I need?

IS_IN_DB(db,'nav.id','%(name)s',lambda parentID, row: 
db(db.nav.parentID==0).select(),zero=T('select a value'))


Kind regards,

Annet

-- 



Reply via email to