[Zope3-dev] bug setting value to None via edit form

Garrett Smith garrett@mojave-corp.com
Sat, 12 Jul 2003 16:23:10 -0500


Steve Alexander wrote:
> I think this is something that needs updating as part of the changes
> to make fields tell widgets what their prefered "missing" value is.
>=20
> In the code you want to change, the "value is not None" should really
> be "value !=3D field.missing_value". However, the rest of the work on
> this has not yet been done.

The value passed to setUpWidget is already converted to its Python form
at this point. So, in my example, IntWidget already converted the empty
string in the HTTP form to None.

Having read over Martijn's use cases, I don't think field's have
'missing_value' attributes -- an attribute that's missing has a None
value, or isn't present. The 'missing' discussion applied to HTTP
attributes to Python mappings.

 -- Garrett