#8898: `required` validation bypassed when using `DateTimeField` with
`SplitDateTimeWidget`.
---------------------------------------------+------------------------------
Reporter: mrmachine | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: SVN
Resolution: | Keywords: DateTimeField
SplitDateTimeWidget
Stage: Design decision needed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Changes (by mrmachine):
* stage: Unreviewed => Design decision needed
Comment:
After some further digging and discussion in #django-dev, I believe that
the validation in `DateTimeField.clean` which is specific for
`SplitDateTimeWidget` should be removed, and users should be guided to use
`SplitDateTimeField` if they want to use `SplitDateTimeWidget`.
It seems that the intention is for `MultiValueField` and
`MultiValueWidget` to be used together, and catching this edge case in
`DateTimeField` to allow it to work with `SplitDateTimeWidget` actually
makes it more difficult for users who might want to subclass
`DateTimeField` and override `clean` to validate against their own
`MultiValueWidget`, because the super class contains validation
specifically for a two item tuple value from `MultiValueWidget`.
This special case validation doesn't actually work properly now anyway, as
it bypasses the `required` validation.
I'm not sure about the history of `DateTimeField` or how and why this
validation was added, so I'm bumping this to DDN.
--
Ticket URL: <http://code.djangoproject.com/ticket/8898#comment:3>
Django <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
-~----------~----~----~----~------~----~------~--~---