[web2py] Re: required=True

2016-12-28 Thread Leonel Câmara
Probably you are sending it an empty string so there is a value there. -- 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 y

[web2py] Re: required=True

2016-12-28 Thread Anthony
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('myfie

[web2py] Re: required=True

2016-12-28 Thread Paolo Caruccio
In addition to the Anthony's answer , if you want also experiment simple native client side validation for web form, you could customize the field widget Field('myfield', 'string', requires=IS_NOT_EMPTY(), widget=lambda f,v: SQLFO

[web2py] Re: required=True for Field type=list:reference

2013-09-02 Thread Anthony
Note, IS_IN_DB(..., multiple=True), which is the default validator for a list:reference field, does allow zero options to be selected, so I suppose the behavior of required=True was made consistent with the validator. Perhaps that should be changed. In any case, using the validator, you can do:

[web2py] Re: required=True for Field type=list:reference

2013-09-02 Thread Mirko
Ok, but if the default validator for a list:reference field does allow zero options to be selected, required=True and required=False makes no difference, isn't it ? Thanks, Mirko On Monday, September 2, 2013 3:15:18 PM UTC+2, Anthony wrote: > Note, IS_IN_DB(..., multiple=True), which is the d

[web2py] Re: required=True for Field type=list:reference

2013-09-02 Thread Anthony
On Monday, September 2, 2013 6:43:56 AM UTC-7, Mirko wrote: > Ok, but if the default validator for a list:reference field does allow > zero options to be selected, required=True and required=False makes no > difference, isn't it ? > If you do an insert via a form, I think it will pass in [] or