Ok here is the new table def.

db.define_table('t_user_has_companies1',
         Field('USER_ID', 'reference auth_user', label='User', 
 writable=True, readable=True, notnull=True, requires=IS_IN_DB(db, 
db.auth_user, '%(id)s %(first_name)s %(last_name)s')),
         Field('COMP_ID', 'reference t_companies', label='Company', 
writable=True, readable=True, notnull=True, requires=IS_IN_DB(db, 
db.t_companies, '%(id)s %(f_coname)s')))
#db.t_user_has_companies1.USER_ID.requires=IS_NOT_IN_DB(db(db.t_user_has_companies1.COMP_ID==request.vars.COMP_ID),db.t_user_has_companies1.USER_ID)

without the commented line (IS_NOT_IN_DB......) i won't be able to have a 
dropdown for the companies but also this line is removing the dropdown for 
the users.

If i comment the line, its not performing as a PK.

-- 
 

*This e-mail is confidential and may also be privileged. If you are not the 
intended **recipient, please notify the sender immediately, delete it from 
your system and do **not copy, disseminate, distribute or disclose any 
information contained therein.*

-- 
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/groups/opt_out.

Reply via email to