[Zope-dev] z3c.form - extraction from sequence widget
Hermann Himmelbauer
dusty at qwer.tk
Fri Aug 29 06:57:10 EDT 2008
Am Donnerstag 28 August 2008 17:45:58 schrieb Marius Gedminas:
> On Thu, Aug 28, 2008 at 05:26:20PM +0200, Hermann Himmelbauer wrote:
> > Am Donnerstag 28 August 2008 10:14:11 schrieb Martin Aspeli:
> > > What about the case when you have a list of options of which you need
> > > to chose one or more? In that case, ticking none is a validation error.
> >
> > Yes, in your case this should give a validation error. However, the case
> > where someone uses a checkbox for a True/False operation is at least as
> > common. And if "no ticking" gives a validation error, this would prevent
> > using checkboxes for this case. Moreover, a checkbox is typically used to
> > represent a "Bool" schema (by default it's a choice widget, I think), so
> > that fits well, I think.
> >
> > My suggestion would be to:
> >
> > - Create some schema field, e.g. "MultipleChoice":
> >
> > colors = MutlipleChoice(title='Colors', values=['red', 'green', 'blue'],
> > default=['green', 'blue'], required=True)
>
> colors = Set(type=u"Choose your favourite colors",
> value_type=Choice(values=['red', 'green', 'blue']),
> min_length=1)
Yes, so it already exists, then.
Best Regards,
Hermann
--
hermann at qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7
More information about the Zope-Dev
mailing list