I see that this has been noted as an issue here:
http://code.google.com/p/web2py/issues/detail?id=382
I am using 1.99.4, anything I can try?
Regards
Mark
On 05/02/12 13:17, Mark Kirkwood wrote:
In order to generate a model with foreign references to itself you
need to use 'reference table' as opposed to db.table in the Field
defines . While this works, I noticed that drop down lists and
id->name mapping were missing from the generated grid. I initially
thought this was due to using the 'reference table' construct - but it
seems not (see below), I have an variant of the 'dogs' app that uses
'reference person' and *those* id->name mapping and drop downs get
created in the grid, but the corresponding ones for sire_id are not.
If I add
db.dog.sire_id.requires = IS_EMPTY_OR(IS_IN_DB(db, 'dog.id'))
in the model then I get a drop down list for potential sire dogs for
editing - so I'm guessing I need to do something with
db.dog.sire_id.represent = ??
However shouldn't this happen automatically?