On Wednesday, December 28, 2016 at 7:24:57 AM UTC-5, Andrea Fae' wrote:
>
> Why if I use this option in Field table database but when I insert and I
> leave not typed this field the system accepted it?
>
If you are making insertions via a form, you are better off using a
validator:
Field('myfield', requires=IS_NOT_EMPTY())
By default, the above will disallow empty strings (which is what you get if
you simply leave the form field blank). Validators are the proper approach
for validating form input because they do not result in exceptions but
instead display user-friendly error messages on the page. If you set
required=True and fail to submit a value, you will get an exception and an
error ticket, with no feedback to the user.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.