#4051: [] not in EMPTY_VALUES in newforms
--------------------------------------------+-------------------------------
Reporter: webograph <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component:
django.newforms
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------------------------+-------------------------------
Comment (by Gary Wilson <[EMAIL PROTECTED]>):
But the fields that do take in a list of values (`MultiValueField` and
`MultipleChoiceField` at least) have `clean` methods that must specially
handle the lists they are given since they must process each item in the
list. Now, there might be a way to factor out some commonalities of
`Field`s that take a list or commonalities of `ChoiceField.clean` and
`MultipleChoiceField.clean` so that these `clean` methods '''could''' call
their parents.
Although, I guess I'm mainly talking about `MultipleChoiceField` above
since it would require some changes to work with its parent,
`ChoiceField.clean`. `MultiValueField` doesn't have a problem though and
could readily call its parent if `[]` was in `EMPTY_VALUES`. There would
be a bit of redundancy there since `MultiValueField.clean` is already
performing a boolean test on the passed value, but that could easily be
fixed.
It seems that end goal is to have the methods be calling their parents
though, a worthy goal I would say so that if things ever changed up the
class hierarchy it wouldn't have to also be fixed on the classes who
aren't calling their parents. But, it doesn't look like simply adding
`[]` to `EMPTY_VALUES` is going to solve this completely.
--
Ticket URL: <http://code.djangoproject.com/ticket/4051#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---