On Saturday, May 14, 2011 9:27:35 AM UTC-4, sebastian wrote: 
>
> yes, it did work ! 
>
> why ?
>
 
According to the book:
 
 
If you want the field validated, but you do not want a dropbox, you must put 
the validator in a list.
  
1.

db.dog.owner.requires = [IS_IN_DB 
<http://web2py.com/book/default/docstring/IS_IN_DB>(db, 'person.id', 
'%(name)s')]

 
 
So, by design, putting the IS_IN_DB validator inside a list causes it not to 
create a dropdown -- as long as it's not inside a list, it will create the 
dropdown. If you need to apply IS_IN_DB in addition to some other validators 
but still want the dropdown, you can add additional validators inside the 
IS_IN_DB call via its '_and' argument. See 
http://web2py.com/book/default/chapter/07#Database-Validators.
 
Anthony
 

Reply via email to