[Zope-dev] z3c.form - extraction from sequence widget

Martin Aspeli optilude at gmx.net
Sat Aug 30 15:15:05 EDT 2008


Hi Roger,

>> Btw., it is possible to have a three-state widget for 
>> booleans, such as a drop-down widget, that includes 
>> "True/False/None", although it may not make much sense.
> 
> No that's not possible! Because you can't save anything 
> then False or True in a Bool field.

Really? How is this different to having a not-required Int, Float, 
TextLine or whatever field, with no default? Do they then semantically 
default to 0, 0.0, "" etc, or are they expected to be None? My 
assumption is that they're None when not explicitly set.

> I think it's always bad idea to use default=None for Bool
> fields. Because of it's invalid defaults.

I guess that depends on whether you think "not set" means "invalid". In 
SQL, for example, any field type can accept NULL (unless the column is 
defined NOT NULL).

Martin
-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Zope-Dev mailing list