Mengu.... Not an option to add validation on the database level other than database type options (like column type, isnull, etc etc).
Massimo's point is that SQLFORM and the Validators provide a pivotal role in web2py, they take the incoming HTML formatted data, and convert this to python types. (ie: a date in html is a formatted string, validators take this and convert it to a datetime.datetime object). If you bypass the Validators, your working with bad data types. -Thadeus On Mon, Mar 15, 2010 at 8:12 AM, mdipierro <mdipie...@cs.depaul.edu> wrote: >> > Second, there is a logical problem. Validators are designed to take >> > the input as submitted by a web form and not as passed to the input >> > function. For example for a IS_DATE a validator expects a "string" in >> > the user locale, while input expects a datetime.date object or an ISO >> > serialized date. >> >> I didn't get this one. how input expects a datetime object? > > Let me make the case with another type. > > db.auth_user.insert(password=encrypted_password) > > while with your patch > > db.auth_user.insert(password=unencrypted_password) > > because the CRYPT validator would convert the unencrypted into the > encrypted password. > > insert expects raw data as it goes in the DB, form contain data > represented as strings. They two are different for almost every type > but text and strings. > > Even if you do not use any helpers it is not a good idea to bypass > accepts(...) > > -- > 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. > > -- 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.