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

2008-08-30 Thread Christian Theune
On Thu, 2008-08-28 at 22:55 +0100, Martin Aspeli wrote: > Hermann Himmelbauer wrote: > > Am Donnerstag 28 August 2008 02:35:28 schrieb Marius Gedminas: > >> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote: > >>> On Wednesday 27 August 2008, Martin Aspeli wrote: > This means tha

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

2008-08-30 Thread Roger Ineichen
Hi Martin > Betreff: Re: [Zope-dev] z3c.form - extraction from sequence widget > > Hi Roger, > > >> Btw., it is possible to have a three-state widget for > booleans, such > >> as a drop-down widget, that includes "True/False/None", > although

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

2008-08-30 Thread Martin Aspeli
Hi Roger, >> Btw., it is possible to have a three-state widget for >> booleans, such as a drop-down widget, that includes >> "True/False/None", although it may not make much sense. > > No that's not possible! Because you can't save anything > then False or True in a Bool field. Really? How is

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

2008-08-30 Thread Carsten Senger
Martin Aspeli schrieb: > Marius Gedminas wrote: >> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote: >>> On Wednesday 27 August 2008, Martin Aspeli wrote: [...] >> Wait a second, maybe I'm misunderstanding this, but I certainly oppose >> any change that would make an unchecked chec

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

2008-08-29 Thread Roger Ineichen
Hi Hermann > Betreff: Re: [Zope-dev] z3c.form - extraction from sequence widget [...] > > I think you *could* interpret it so that a boolean field that's > > required really means "you have to tick this box" (e.g. an > "I agree to > > these terms

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

2008-08-29 Thread Hermann Himmelbauer
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 mo

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

2008-08-29 Thread Hermann Himmelbauer
Am Donnerstag 28 August 2008 23:55:24 schrieb Martin Aspeli: > Hermann Himmelbauer wrote: > > Am Donnerstag 28 August 2008 02:35:28 schrieb Marius Gedminas: > >> On Wed, Aug 27, 2008 at 05:15:48PM -0700, Stephan Richter wrote: > >>> On Wednesday 27 August 2008, Martin Aspeli wrote: > This mean

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

2008-08-28 Thread Martin Aspeli
Hermann Himmelbauer wrote: > Am Donnerstag 28 August 2008 02:35:28 schrieb Marius Gedminas: >> 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

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

2008-08-28 Thread Martin Aspeli
Stephan Richter wrote: > On Thursday 28 August 2008, Martin Aspeli wrote: >> I suspect that we just need widget.SequenceWidget in z3c.form to have a >> special case for len(self.terms)==1, i.e. it's a checkbox with only one >> option, or maybe a special case for a BooleanField, or indeed have >> di

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

2008-08-28 Thread Stephan Richter
On Thursday 28 August 2008, Martin Aspeli wrote: > I suspect that we just need widget.SequenceWidget in z3c.form to have a > special case for len(self.terms)==1, i.e. it's a checkbox with only one > option, or maybe a special case for a BooleanField, or indeed have > different widgets for Boolean a

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

2008-08-28 Thread Martin Aspeli
Hermann Himmelbauer wrote: > Am Donnerstag 28 August 2008 10:14:11 schrieb Martin Aspeli: >> Marius Gedminas wrote: >>> 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-mar

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

2008-08-28 Thread 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

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

2008-08-28 Thread Stephan Richter
On Wednesday 27 August 2008, Marius Gedminas wrote: > > 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 certain

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

2008-08-28 Thread Hermann Himmelbauer
Am Donnerstag 28 August 2008 10:14:11 schrieb Martin Aspeli: > Marius Gedminas wrote: > > 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 w

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

2008-08-28 Thread Martin Aspeli
Marius Gedminas wrote: > 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 [],

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

2008-08-28 Thread Hermann Himmelbauer
Am Donnerstag 28 August 2008 02:35:28 schrieb Marius Gedminas: > 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 wi

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

2008-08-27 Thread Marius Gedminas
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 (NOVAL

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

2008-08-27 Thread Stephan Richter
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

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

2008-08-27 Thread Martin Aspeli
Hi, In z3c.form.widget.SequenceWidget, we have: def extract(self, default=interfaces.NOVALUE): """See z3c.form.interfaces.IWidget.""" if (self.name not in self.request and self.name+'-empty-marker' in self.request): return [] value = self.