Now the error message changes to:
Enter a number between -1e+100 and 1e+100
On Thursday, January 17, 2019 at 6:41:02 PM UTC+8, sandeep patel wrote:
>
> @lyn2py
> instead of using Field Type Integer use double
> Like This
> Field('one_field_only', 'double'))
>
> Thanks
> SP
>
> On Thu, Jan 17, 2019 at 3:47 PM lyn2py <[email protected] <javascript:>>
> wrote:
>
>> My code did not change, but upgrading web2py caused my Form Validation to
>> fail.
>>
>> Older (working) version: Version
>> 2.17.1-stable+timestamp.2018.08.05.17.57.00
>>
>> New (not working) version: Version
>> 2.17.2-stable+timestamp.2018.10.06.11.34.06
>>
>> Controller Code (did not change):
>> def index():
>> form = SQLFORM.factory(
>> Field('one_field_only', 'integer')
>> )
>>
>> if form.process(onvalidation=form_validation).accepted:
>> response.flash = 'form accepted'
>> elif form.errors:
>> response.flash = 'form has errors'
>> else:
>> response.flash = 'please fill the form'
>> return dict(form=form)
>>
>> def form_validation(form):
>> if form.vars.one_field_only=="":
>> form.errors.one_field_only = "My custom error"
>> ...more validation here...
>>
>> As mentioned it worked with the older version. In the new/latest version,
>> the form_validation error did not work, instead it seems that web2py
>> generated an error message that says "Enter an integer between
>> -2.14748e+09 and 2.14748e+09"
>>
>> I need to resolve this issue, as the code is on production
>> servers. Kindly teach me how to bypass web2py's validators so I can use my
>> own form validation. Thank you very much!
>>
>>
>> --
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
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.