If you put the validator in a list, you lose the dropdown -- so just take it out of the list. Also, use IS_EMPTY_OR (IS_NULL_OR has been deprecated).
Anthony On Saturday, March 9, 2013 4:37:32 PM UTC-5, memo wrote: > > I have the below stated table definition: > I want the field f_building_complex to be either NULL or to be referenced > to the t_building_complexes. > Thus I have added the requires=...... > But now the sqlform displays a text box instead of a dropdown. What to do? > Thanks > > > db.define_table('t_addresses', > Field('f_street', type='reference t_streets', > label=T('Street')), > Field('f_building_complex', type='reference > t_building_complexes',requires = > [IS_NULL_OR(IS_IN_DB(db,db.t_building_complexes))], > label=T('Building Complex')), > Field('f_streetno', type='string', > label=T('Streetno')), > Field('f_block', type='string', > label=T('Block')), > Field('f_unitno', type='string', > label=T('Unitno')), > Field('f_latitude', type='decimal(10,8)', > label=T('Latitude')), > Field('f_longitude', type='decimal(11,8)', > label=T('Longitude')), > auth.signature, > format='%(f_street_streets)s', > migrate=settings.migrate) > > -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.