> > *db.define_table('t_user_has_companies',* > * Field('first_name', 'reference auth_user', label='User', > writable=True, readable=True, notnull=True, required=True, ondelete='NO > ACTION', requires=IS_IN_DB(db, db.auth_user, '%(id)s %(first_name)s > %(last_name)s')),* > * Field('f_coname', 'reference t_companies', > label='Company', writable=True, readable=True, notnull=True, required=True, > ondelete='NO ACTION', requires=IS_IN_DB(db, db.t_companies, '%(id)s > %(f_coname)s'))* > * )* > > *db.t_user_has_companies.first_name.requires=IS_NOT_IN_DB(db(db.t_user_has_companies.f_coname==request.vars.f_coname),db.t_user_has_companies.first_name)* > > hm, i think the problem is on your requires for first_name field in user_has_companies table. could you test to make the first_name field in user_has_companies table more simple first, after that add the DAL field constructor one by one. e.g. *db.define_table('t_user_has_companies',* * Field('first_name', 'reference auth_user'),* * Field('f_coname', 'reference t_companies', label='Company', writable=True, readable=True, notnull=True, required=True, ondelete='NO ACTION', requires=IS_IN_DB(db, db.t_companies, '%(id)s %(f_coname)s'))* * )* p.s. for combine requires field constructor i think you can use the list [] for that. e.g. table.email.requires = [IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db, table.email) ]
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 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.