I would rather use a string field with a drop box as it may arrive that you add more filter creteria, your three state bool wouldn't be enough once there...
It makes your system less custom and easier to extend... Richard On Fri, Jul 8, 2016 at 10:41 AM, Alfonso Serra <aleonse...@gmail.com> wrote: > You are right. The real scenario is: > Im using a table to store filters that are used to retrieve data from > another table. > > This other table are bookings, and i need a filter to retrieve either all > of them, or with kids, or without them. > > The form of such filters has 3 kind of submits "Execute filter", "Save > Filter" and "Delete Filter", Save Filter will also execute the filter. > Depending on which one i submit i save the form or not. > > In any case the "with_kids" fields from the filter's table should be a > boolean tristate, that i should handle properly when the form is processed. > Not when the form its saved into the db, if its saved. > > I think i have a few choices, either use the form's onvalidation callback > or declare the tristate in the filed definition via validator or widget. > The latter should be better since i wont have to worry later on, that what > im looking now. > > Thanks. > > > -- > 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. > -- 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.