[Zope3-dev] field validation in edit form

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


On Sat, Jul 12, 2003 at 04:38:06PM -0400, Brad Bollenbach wrote:
> 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.

Slight correction: a MissingInputError is appended to an error list,
which, if not empty will cause a WidgetsError to be raised (unless you
passed do_not_raise=True).

I blame it on the fact that I only started evaluating Zope 3 for use on
a Real Project about 72 hours ago. :P

--
Brad Bollenbach
BBnet.ca