I defined 2 tables as follows:
db.define_table('offer', Field.Virtual('title', title_func)
> db.define_table('discussion', Field('offer_id', reference offer)
With title_func() a function that builds a string based on other fields in
the 'offer' table.
db.offer.format = '%(title)s
Now when I use appadmin and look at the 'discussion' table, all the
referenced records are properly represented with my function.
But if I click on a 'discussion' id record to display the update form, the
'select' input doesn't display the proper record representation for
referenced fields.
I tried to put a print at the beginning of my offer_func() in 'offer' model
and ended up with this upon loading the previous update form :
[...] <Row {'offer': {'id': 308L}}> [...]
Which means that my virtual field somehow has full access to the fields it
requires in the regular appadmin menu but doesn't have access to those in
the update form. Just the id field.
Is this a bug ? Am I doing something wrong ??
--
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.