plese see book
http://web2py.com/books/default/chapter/29/06
- Keyed tables can only reference other keyed tables.
- Referencing fields must use the reference tablename.fieldname format.
maybe you mean is format, so the basic is in define table you use reference
to other primary key other table which is id, and then in web form you want
to see the other field not the id.
for example :
# create table : company
db.define_table('company',
Field('company_name', length=10, notnull=True, unique=True),
format='%(company_name)s')
# create table : branch
db.define_table('branch',
Field('address', 'text', notnull=True, unique=True),
Field('company', 'reference company', notnull=True),
format='%(address)s')
when you add the web form branch, you will see the company_name value in
the field company, not the company id.
--
---
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/groups/opt_out.