On Thu, 2007-11-15 at 06:47 -0800, Milan Andric wrote:
>
>
> On Nov 9, 12:34 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
> > On Fri, 2007-11-09 at 06:26 +, Milan Andric wrote:
> >
> > > On Nov 9, 12:02 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > > wrote:
> > > > > Shouldn't the f
I haven't quite figured this out myself but here's what I do.
By default all form fields have required=True. So, specifying
required=True is not necessary. If the default value is True, pre-
check the checkbox with initial={'checkme': True}. If the default
value is False, specify required=Fal
On Nov 9, 12:34 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-11-09 at 06:26 +, Milan Andric wrote:
>
> > On Nov 9, 12:02 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > wrote:
> > > > Shouldn't the form give errors and not validate?
>
> > > Nope. It's a bit tricky, though.
On Fri, 2007-11-09 at 06:26 +, Milan Andric wrote:
>
>
> On Nov 9, 12:02 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
> > > Shouldn't the form give errors and not validate?
> >
> > Nope. It's a bit tricky, though. The problem is that HTML forms do not
> > send *anything* for a checkbo
On Nov 9, 12:02 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> > Shouldn't the form give errors and not validate?
>
> Nope. It's a bit tricky, though. The problem is that HTML forms do not
> send *anything* for a checkbox that you don't check. So missing data for
> a checkbox field means it
On Fri, 2007-11-09 at 05:40 +, Milan Andric wrote:
> I might be misunderstanding the documentation about BooleanField.
> http://www.djangoproject.com/documentation/newforms/#booleanfield
>
> but it seems if i have :
>
> >>> class Foo(forms.Form):
> bool = forms.BooleanField(required=Tru
I might be misunderstanding the documentation about BooleanField.
http://www.djangoproject.com/documentation/newforms/#booleanfield
but it seems if i have :
>>> class Foo(forms.Form):
bool = forms.BooleanField(required=True)
>>> f=Foo({})
>>> f.is_valid()
True
>>>f.cleaned_data
{'b': False}
7 matches
Mail list logo