I think you want:
tablename, fieldname = specificTableToSearchMembersFromID.split('.')
db.Role.object_super_object_FK.requires = IS_IN_DB(db
(db[tablename][fieldname]),
'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose
one'))
On Friday, 1 September 2017 16:36:10 UTC-5,
well, maybe it is usable, but is this a hack that could be formatted better?
specificTableToSearchMembersFromID = str(specificTableToSearchMembersFromID)
+ '.id' db.Role.object_super_object_FK.requires =
IS_IN_DB(db(specificTableToSearchMembersFromID
> 0),
still could use some advice to make it work in usable way
does the var need special braces or syntax to be recognized?
db.Role.object_super_object_FK.requires = IS_IN_DB(db ([
specificTableToSearchMembersFromID]),
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
well, I got a variable to work at least:
specificTableToSearchMembersFromID = 'cost_center.id>0'
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'))
--
Resources:
-
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
sorry, should have mentioned that I tried that and every combination
possible
--
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
had you tried ?
e.g.
specificTableToSearchMembersFromID = db.cost_center.id
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
7 matches
Mail list logo