is
db.Role.object_super_object_FK.requires = IS_IN_DB(db (db.cost_center.id),
'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose
one'))
really work ?
*from the book :*
IS_IN_DB(db|set,'table.value_field','%(representing_field)s',zero='choose
one')
where the third and fourth arguments are optional.
*ref:*
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Database-validators
When you call db with a query, you define a set of records. You can store
it in a variable s and write:
*ref:*
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Query--Set--Rows
not sure db (db.cost_center.id) is a set i think it should be :
db(db.cost_center.id > 0)
so another thing is in your desire var is written :
db ( [specificTableToSearchMembersFromID] )
i think it should be
db(specificTableToSearchMembersFromID)
no bracket [] and the () is stick to the db() not db ()
*pls try (not tested) :*
specificTableToSearchMembersFromID = db.cost_center.id
db.Role.object_super_object_FK.requires =
IS_IN_DB(db(specificTableToSearchMembersFromID),
'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose
one') )
best regards,
stifan
--
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.