I have the company id in my request.vars.emp variable So its easy
IS_IN_DB(db(db.trabalhador.company==request.vars.emp), ---- It works the request variable is amazingly powerfull.... thank you 2013/9/11 Anthony <abasta...@gmail.com> > On Wednesday, September 11, 2013 7:22:36 AM UTC-4, viniciusban wrote: > >> In validators section in the book [1], there is an example of >> IS_NOT_IN_DB() using a query. >> It can be done in IS_IN_DB(), too. >> > > That will work if you know the company id before the form is served, but > if the company is also selected within the same form, then you need to use > an ajax solution to filter the worker list after the company is selected -- > for some options, see > http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910 > . > > Anthony > > -- > 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 web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.