I defined the following table: db.define_table('paymentdata', Field ('company',db.company,default='',notnull=True,ondelete='CASCADE',unique=True), Field('account',length=10,default='',notnull=True), Field('BIC',length=8,default='',notnull=True), Field('IBAN',length=34,default='',notnull=True), Field('VAT',length=24,default='',notnull=True), Field('created_on',type='datetime',writable=False,readable=False), Field ('modified_on',type='datetime',writable=False,readable=False), migrate='paymentdata.table')
db.paymentdata.company.requires=[IS_IN_DB(db,db.company.id,'% (companyname)s'),IS_NOT_IN_DB(db,'company.id',error_message=T ('paymentdata already in database'))] The user shouldn't be able to enter paymentdata more than once, I thought by making company unique and defining the validator I would implement that constraint. However, even when inserting a record in an empty paymentdata table I get the error message ' paymentdata already in database'. Why? Kind regards, Annet -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.