nope, i did a test and confirmed that this behavior is the same for older 
and newer versions of web2py.

so to get the name field from the referenced table to show, you need to add 
a represent parameter to your field construction:

db.define_table('stuff',
    Field('name', 'string', notnull=True, unique=True,
          requires=[IS_NOT_EMPTY(),
                    IS_NOT_IN_DB(db,'stuff.name')]),
    format='%(name)s',
    migrate=migrate)

db.define_table('refers_to_stuff',
   Field('stuff', db.stuff,
         requires=IS_IN_DB(db, db.stuff.id, '%(name)s'),
         represent=lambda x: db.stuff[x].name),
   migrate=migrate)

and i confirmed that my other post was misguided.  in older versions of 
web2py you need a represent on referenced read-only fields as well if you 
want them to display something other than the ID.

Reply via email to