db.table.field.requires = IS_NOT_IN_DB(db, db.othertable.otherfield)

means each table.field value has to be unique

db.table.field.requires = IS_IN_DB(db, db.othertable.otherfield, '%
(othefield2)s')

means that table field stores a db.othertable.otherfield that must be
in the DB but dropboxes should not show the value, they should instead
show the string  '%(othefield2)s' instead.  '%(othefield2)s' will be
replaced by the value of the otherfield2 of the referenced record.


On Apr 24, 2:10 pm, Pynthon <[email protected]> wrote:
> Hello
>
> Sorry for all the questions :$. I've got this validator:
>
> data.comment.image.id.requires = IS_IN_DB(db, db.image.id, '%(title)
> s')
>
> It says it needs to be in the db. What what does (db, db.image.id, '%
> (title)s') mean? And: IS_NOT_IN_DB(db, db.image.title). That means
> that the value of image title cannot be in the database right?
>
> 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