[Django] #25573: Add simple way to use SplitDateTimeField on ModelForms

27 views
Skip to first unread message

Django

unread,
Oct 20, 2015, 5:44:06 AM10/20/15
to django-...@googlegroups.com
#25573: Add simple way to use SplitDateTimeField on ModelForms
--------------------------------------+--------------------
Reporter: seddonym | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: 1.9a1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
If you specify a `SplitDateTimeWidget` as the custom widget for a
`DateTimeField` on a `ModelForm`, you receive this deprecation warning:

{{{
RemovedInDjango19Warning: Using SplitDateTimeWidget with DateTimeField is
deprecated. Use SplitDateTimeField instead.
}}}

My understanding is that the only way to do this for a `ModelForm` based
on a model with a `DateTimeField`, is to subclass `models.DateTimeField`
like this: https://gist.github.com/nacady/8dd5cab2f749d1589f1e.

Perhaps we should provide a simpler way of using the SplitDateTimeField
with ModelForms?

--
Ticket URL: <https://code.djangoproject.com/ticket/25573>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 21, 2015, 9:30:29 AM10/21/15
to django-...@googlegroups.com
#25573: Add simple way to use SplitDateTimeField on ModelForms
-------------------------------------+-------------------------------------
Reporter: seddonym | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Forms | Version: 1.9a1
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0


Comment:

The `ModelForm.Meta.field_classes` feature added in Django 1.9 should
allow this (#24295).

--
Ticket URL: <https://code.djangoproject.com/ticket/25573#comment:1>

Django

unread,
Oct 22, 2015, 9:41:56 AM10/22/15
to django-...@googlegroups.com
#25573: Add simple way to use SplitDateTimeField on ModelForms
-------------------------------------+-------------------------------------
Reporter: seddonym | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Forms | Version: 1.9a1
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by seddonym):

Oh, great feature - yes, this will do the trick.

--
Ticket URL: <https://code.djangoproject.com/ticket/25573#comment:2>

Reply all
Reply to author
Forward
0 new messages