On Friday, July 8, 2016 at 11:21:53 AM UTC-4, Alfonso Serra wrote: > > Ill read about custom fields, that may be interesting, but since the bool > conversion is done on form's process i dont think it will do the trick. But > a custom field might not do the conversion. >
As long as the custom field does not have type='boolean', SQLFORM will not convert it. But that's actually a problem, because then your form.vars value will be a string instead of a Python boolean. However, you can also add a custom validator to the field that will convert to boolean. This approach is nice because it (a) is handled entirely in the table definition and does not involve any form callbacks and (b) allows the underlying storage type for the field to remain boolean. If you don't want to bother with a custom field type, you can also just use an integer field as an alternative. 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.