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

Marius Gedminas marius at gedmin.as
Wed Aug 27 20:35:28 EDT 2008


On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote:
> On Wednesday 27 August 2008, Martin Aspeli wrote:
> > This means that if the request contains the empty-marker only (no
> > selection was made) for a checkbox widget (say), then the return value
> > is [], rather than default (NOVALUE).
> >
> > Is that a bug? I have a custom checkbox widget derived from the standard
> > checkbox widget, (z3c.formwidget.query, in fact), and I never get any
> > "required missing" exceptions, even when I untick all the checkboxes and
> > click OK.
> >
> > Am I missing something?
> 
> I think you have a point. Have you tried changing the behavior to 
> return "default" and see what tests fail? If no major failures come out of 
> this, I would say change it.

Wait a second, maybe I'm misunderstanding this, but I certainly oppose
any change that would make an unchecked checkbox an error during form
validation.

A required Bool field can have two values: True or False.  One is
represented by a checked checkbox, the other by an unchecked checkbox.
An unchecked checkbox is not missing input and should not trigger
"required missing" errors.

Marius Gedminas
-- 
As easy as 3.14159265358979323846264338327950288419716
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20080827/bb3488d6/attachment.bin 


More information about the Zope-Dev mailing list