Hi Massimo,

Here is the table def i'm using for this

db.define_table('t_user_has_companies',
                Field('USER_ID', 'reference auth_user', label='User', 
writable=True, readable=True, notnull=True, required=True,  ondelete='NO 
ACTION'),
                Field('COMP_ID', 'reference t_companies', label='Company', 
writable=True, readable=True, required=True, ondelete='NO ACTION', 
requires=IS_IN_DB(db, db.t_companies, '%(id)s %(f_coname)s')))

What i'm trying to do is a KEY UserID from auth_user table and CompanyID 
from the companies table, so they don't duplicate in the table 
user_has_companies.

<https://lh6.googleusercontent.com/-2igroVtO_eQ/UqzF5RLkuPI/AAAAAAAAALc/S8Z70UhJxkg/s1600/Untitled-1.jpg>
the grid is displaying the attached screenshot

<https://lh3.googleusercontent.com/-6y3FBZzY0nU/UqzG07fv6oI/AAAAAAAAALk/-UWSs5TxmP4/s1600/Untitled-1.jpg>
with this def, i can see both drop downs but i can submit the same company 
to the same user over and over

Thanks for your help

-- 
 

*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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to