[web2py] Re: how to pass table name to controller?

2017-09-10 Thread Massimo Di Pierro
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,

[web2py] Re: how to pass table name to controller?

2017-09-04 Thread Alex Glaros
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),

[web2py] Re: how to pass table name to controller?

2017-09-04 Thread Alex Glaros
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) -

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread Alex Glaros
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: -

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread 黄祥
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

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread Alex Glaros
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

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread 黄祥
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