Notice how I have validators set on the database level of web2py.

db.table.field.requires = IS_IN_DB(...)

I only use SQLFORM.factory to create my forms. I only use
SQLFORM.factory because for my purposes forms cannot be mapped
directly to database tables.

Take a reference field for example, I want my database to store it as
an ID, however I want the form to allow input as another field in the
reference table, say "name".

So for this I use a different IS_IN_DB validator for my
sqlform.factories than the IS_IN_DB for a reference field.

IS_IN_DB(db, 'signup.code') vs IS_IN_DB(db, 'signup.id'), but my
database actually stores the ID, so on form.accepts I query for the
records id.

So here is my question, are validators used anywhere else in web2py
except by crud and SQLFORM ? Am I safe by not setting validators on
the database level  ?

Now sometimes I will use a field as is straight from the database
(like the gender column), in this case I can see setting a
database-level validator and then when creating my SQLFORM.factory,
just referencing the fields I know arn't special.

-Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to