Hi, I'm using a custom form to represent the fields of a table. This table
has referenced fields.
If I use:
db.define_table('department',
Field('dept_id'),
Field('nombre'),format='%(nombre)s')
db.define_table('employee',
Field('firstName'),
Field('lastName'),
Field('dept_id', db.department))
The table employee represents correctly the dept names. But if I do:
db.define_table('employee',
Field('firstName'),
Field('lastName'),
Field('dept_id', db.department), requires=IS_EMPTY_OR(IS_IN_DB(db,
db.department.id,
'%(nombre)s')))
{{=form.custom.widget.dept_id}} shows the departament id instead of the
name.
I need to add the "IS_EMPTY_OR" condition, I've also tried adding
notnull=False without success.
Any hint?
Thanks.
José L.
--
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.