On Feb 19, 10:47 am, ctalley <[email protected]> wrote:
> Now *why* it works is a little puzzling. From the web2py manual...
>
> IS_IN_SET checks that the field values are in a set: requires=IS_IN_SET
> (['a','b','c'],error_message=T('must be a or b or c'))
>
> Notice IS_IN_SET has two arguments - the 'set' (a list of strings),
> and an error message in case it fails.
When in doubt go to the source, literally in this case.
IS_IN_SET actually has four parameters:
theset, labels, error_message and (more recently) multiple.
Take a peek at gluon/validators.py, it is great to be able to see for
yourself how the magic is done, gotta love open source.
>
> The IS_IN_SET I'm using also has two arguments - from the first is the
> foreign key that's inserted in the doc.Assessment_id field, and the
> second populates the doc.Assessment_id drop down list in the 'New
> Record' form. I never would have figured IS_IN_SET could do what it's
> doing, but it is. Not intuitive to say the least.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---