Hi ionel,
it is not a bug. The validatior should be
db.book.author.requires=[IS_UPPER(), IS_NOT_IN_DB(db
((db.book.title==request.vars.get('title','').upper())&
(db.book.volume==request.vars.volume)),'book.author')]
since the title is in always in upper case in the db but it may not be
in upper case in the request.vars.
On Feb 9, 10:00 pm, ionel <[email protected]> wrote:
> Hello Massimo,
>
> Any solution for this problem?
>
> Thanks
>
> ionel
>
> On Feb 1, 9:26 am, mdipierro <[email protected]> wrote:
>
> > Let me try this....
>
> > On Feb 1, 9:41 am, ionel <[email protected]> wrote:
>
> > > I already did that:
>
> > > 1) db.book.title.requires=IS_UPPER()
> > > db.book.author.requires=IS_UPPER()
> > > db.book.author.requires=IS_NOT_IN_DB(db
> > > ((db.book.title==request.vars.title)&
> > > (db.book.volume==request.vars.volume)),'book.author')
>
> > > INPUT: RESULT IN DATABASE:
> > > Author, Title Author, Title
> > > python python python PYTHON
> > > PythoN PythoN PythoN PYTHON
>
> > > IS_UPPER don't works for Author!
>
> > > 2) db.book.title.requires=IS_UPPER()
> > > db.book.author.requires=[IS_UPPER(), IS_NOT_IN_DB(db
> > > ((db.book.title==request.vars.title)&
> > > (db.book.volume==request.vars.volume)),'book.author')]
>
> > > INPUT: RESULT IN DATABASE:
> > > Author, Title Author, Title
> > > python python PYTHON PYTHON
> > > PythoN PythoN PYTHON PYTHON
>
> > > The result is 2 identical records in database despite of IS_NOT_IN_DB!
>
> > > Thanks.
>
> > > ionel
>
> > > On Feb 1, 4:12 am, Fran <[email protected]> wrote:
>
> > > > > db.book.author.requires=[IS_UPPER(),
> > > > > IS_NOT_IN_DB(db((db.book.title==request.vars.title)&
> > > > > (db.book.volume==request.vars.volume)),'book.author')]
> > > > > The condition "IS_NOT_IN_DB" don't works anymore.
>
> > > > Split across 2 lines:
> > > > db.book.author.requires=IS_UPPER()
> > > > db.book.author.requires=IS_NOT_IN_DB(db
> > > > ((db.book.title==request.vars.title)&
> > > > (db.book.volume==request.vars.volume)),'book.author')
>
> > > > F
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---