Something like this?

class IS_THERE:
    def __init__(db,fields, error_message='not there'):
        self.db=db
        self.fields=fields
        self.error_message=error_message
    def __call__(self,value):
        for field in self.fields:
             if self.db(field==value).count(): return (value,None)
        return (value,self.error_message)

requires=IS_THERE(db,
(db.table1.field1,db.table2.field2,...db.table8,field8))


On Jul 9, 1:25 am, phneoix <[email protected]> wrote:
> only need to validate.
>
> On Jul 8, 11:03 pm, mdipierro <[email protected]> wrote:
>
> > only validate or you need a selection dropdown? You need your own
> > validator. Look into the code for IS_IN_DB and it is not difficult to
> > make your own.
>
> > On Jul 8, 11:53 pm, phneoix <[email protected]> wrote:
>
> > > hi,
> > >    i am having about 8 different lookup tables in my database. i need
> > > to validate whether the entry is in any one of the 8 tables.
>
> > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to