Learnt something new today. Thanks Massimo :)
On Feb 24, 4:44 am, Massimo Di Pierro <massimo.dipie...@gmail.com> wrote: > Notice is works even without the []: > > db.ips.ipaddress.requires = IS_IPV4(), > IS_NOT_IN_DB(db, > 'ips.ipaddress') > > tuples in python do not requires brackets, only commas. > > On Feb 23, 11:20 am, Anthony <abasta...@gmail.com> wrote: > > > > > > > > > On Thursday, February 23, 2012 12:11:48 PM UTC-5, Larry Wapnitsky wrote: > > > > I'm trying to use the following in my applications, but only one works at > > > a time: > > > > db.ips.ipaddress.requires = IS_NOT_IN_DB(db, 'ips.ipaddress') > > > db.ips.ipaddress.requires = IS_IPV4() > > > > How can I get them both to process? > > > Your second assignment is overwriting your first. For multiple validators, > > put them in a list: > > > db.ips.ipaddress.requires = [IS_IPV4(), IS_NOT_IN_DB(db, 'ips.ipaddress')] > > > Seehttp://web2py.com/books/default/chapter/29/7#Validators. > > > Anthony