In this line:

IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),

db.companyapplication.application is a reference field (i.e. an
integer)
request.vars.application is a string 'Supplier'. That is the problem.

Please explain in words what these table represent and what you want
to achieve. I am sure we can find a solution.

Massimo



On Apr 20, 10:19 am, annet <annet.verm...@gmail.com> wrote:
> Massimo,
>
> > The error refer to a field Supplier and I do not see it defined.
>
> 'Supplier is the value I enter for the Field application in the
> application table.
>
> > Some other part of the code is causing the problem and I cannot help tell
> > without look at it all.
>
> Yes, the validator defined after the companyapplication table:
>
> db.define_table('companyapplication',
>     Field('company',db.company,),
>     Field('application',db.application),
>     migrate=False)
>
> db.companyapplication.company.requires=[IS_IN_DB(db,db.company.id,'%
> (company)s'),\
> IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),
> \
> db.companyapplication.company,error_message='combination
> of company en application already in database')]
>
> That's all the information related to this problem. I hope it's enough
> to solve the problem, because it's a recurrent one.
>
> Kind regards,
>
> Annet.
>
> --
> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en

Reply via email to