[Zope3-dev] field validation in edit form

Brad Bollenbach brad@bbnet.ca
Sat, 12 Jul 2003 16:38:06 -0400


On Sat, Jul 12, 2003 at 02:23:51PM -0500, Garrett Smith wrote:
> Why is the edit form configure *not* to validate field input? This is
> hard coded at line 150 of zope/app/browser/form/editview.py -- see
> 'strict':
> 
> data = getWidgetsData(self, self.schema,
>     strict=False,
>     set_missing=True,
>     names=self.fieldNames,
>     exclude_readonly=True)

Setting strict to True doesn't validate the data, it just raises a
MissingInputError if a required field is missing.

However, by passing strict=False *with* set_missing=True a missing
field's value will get set to its missing value.

Your suggestion to make this configurable may or may not remain useful,
depending on whether or not the current behaviour would be considered to
be Doing The Right Thing.

--
Brad Bollenbach
BBnet.ca