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')] See http://web2py.com/books/default/chapter/29/7#Validators. Anthony