Ash wrote:
> What would be the point in opening a ticket when this clearly broken
> behavior gets marked as 'wontfix'?
> 
> http://code.djangoproject.com/ticket/4981

I believe SmileyChris meant that a ticket should be opened about
updating the documentation.

> The documents for Django newforms state that:
> 
> BooleanField
> 
>     * Default widget: CheckboxInput
>     * Empty value: None
>     * Normalizes to: A Python True or False value.
>     * Validates nothing (i.e., it never raises a ValidationError).
> 
> 
> Note the last line. But when you actually go and use the field and
> don't check it, it DOES raise a validation error, saying that "This
> field is required."
> 
> It is silly to say here that all boolean fields must be made
> 'required=False' in order to work. That's not in the docs, and it's a
> silly hoop to ask developers to jump through just to be able to have a
> useful checkbox field. The field itself should be smart enough to know
> that unchecked == False. Not that unchecked == missing. The documented
> normalizing to either True or False is not happening at all.

As mentioned in the comments of the ticket you mentioned above, there
are times when you do want to ensure the check box was checked
(required=True).  When you do not want to force the user to check the
box, then you use required=False.  I wouldn't say it's a hoop to jump
through, but rather just a configuration for the way you want your check
box to work.

Gary

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to