[Django] #22684: SelectDateWidget's none_value is not changeable

64 views
Skip to first unread message

Django

unread,
May 22, 2014, 11:44:52 AM5/22/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+--------------------
Reporter: danielsamuels | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------
If you want to use a SelectDateWidget to represent your DateField, your
output will have "---" as the default option text, this text is not
changeable to suit the needs of each individual application in the same
way that other fields can have their default set. I believe this widget
should gain a new attribute such as `empty_label` to match standard
ChoiceFields.

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

Django

unread,
May 22, 2014, 11:45:01 AM5/22/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+--------------------------------------

Reporter: danielsamuels | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* cc: danielsamuels (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


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

Django

unread,
May 22, 2014, 12:40:33 PM5/22/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------

Reporter: danielsamuels | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by claudep):

* easy: 0 => 1
* stage: Unreviewed => Accepted


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

Django

unread,
May 22, 2014, 4:42:27 PM5/22/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by gyx1000):

* owner: nobody => gyx1000
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:3>

Django

unread,
May 23, 2014, 3:16:51 AM5/23/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by gyx1000):

PR available for review at:
[https://github.com/django/django/pull/2704]

Thanks

PS : I need help for change documentation
Because this new feature is assigned to version 1.6. I don't know how add
informations for this feature in docs/ref/forms/widgets.txt

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:4>

Django

unread,
May 23, 2014, 3:17:17 AM5/23/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by gyx1000):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:5>

Django

unread,
May 23, 2014, 12:02:25 PM5/23/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by claudep):

* version: 1.6 => master


Comment:

I left some comments on the PR. This will only be considered for 1.8, as
1.7 is already feature-frozen.

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:6>

Django

unread,
May 23, 2014, 3:11:55 PM5/23/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by gyx1000):

Thanks for your comments on the PR.
I make needed changes.

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:7>

Django

unread,
May 23, 2014, 4:43:57 PM5/23/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by claudep):

* needs_docs: 0 => 1


Comment:

Great, now only the docs are missing.
https://docs.djangoproject.com/en/dev/ref/forms/widgets/#selectdatewidget

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:8>

Django

unread,
May 24, 2014, 2:39:52 AM5/24/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by gyx1000):

I have change the documentation with this new feature.

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:9>

Django

unread,
May 24, 2014, 5:06:14 AM5/24/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by claudep):

@danielsamuels: does the proposed implementation fulfill your use case?

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:10>

Django

unread,
May 28, 2014, 1:24:32 PM5/28/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"32586b0ba43816d325be0ce807f75623683eed7a"]:
{{{
#!CommitTicketReference repository=""
revision="32586b0ba43816d325be0ce807f75623683eed7a"
Fixed #22684 -- Added `empty_label` option on
`django.forms.extras.widets.SelectDateWidget`

Thanks danielsamuels for the report
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:11>

Django

unread,
May 29, 2014, 6:47:14 AM5/29/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by danielsamuels):

Apologies for the slow reply, seems as though being CC'd doesn't actually
send emails. As far as I can see, this isn't providing the option to
change the empty_label for each field individually. The widget provides 3
<select> fields, one for day, one for month and one for year, the pull
request appears to be setting the empty value for all 3 at the same time.
What I would like to be able to achieve is to have 'Day' as the default
value for the Day dropdown, 'Month' as the default for the month dropdown
and 'Year' as the default for the year dropdown. I'm not entirely sure
what an appropriate default value could even be used with this pull
request, as it would need to be relevant for all 3 dropdowns, which
doesn't really seem very flexible.

My proposal would be to have 3 kwargs in place of the current 1, something
along the lines of `day_empty_label`, `month_empty_label` and
`year_empty_label`, this would give all of the flexibility required.

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:12>

Django

unread,
May 29, 2014, 7:50:28 AM5/29/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by timo):

* status: closed => new
* resolution: fixed =>


Comment:

Or maybe change `empty_label` -> `empty_labels` and make it a 3-tuple
corresponding to year/month/day?

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:13>

Django

unread,
May 29, 2014, 8:09:28 AM5/29/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by gyx1000):

For me, change the empty_label to empty_labels (3-tuple) seams to be a
good idea.
What do you think @danielsamuels ?

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:14>

Django

unread,
May 29, 2014, 10:22:02 AM5/29/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by gyx1000):

We can also keep empty_label and accept a string or a 3-tuple ?
If a string is passed, all select will have the same empty_value
otherwise, select will have corresponding values.

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:15>

Django

unread,
May 29, 2014, 11:40:54 AM5/29/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned

Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by gyx1000):

* status: new => assigned


Comment:

The new PR for review and remarks

https://github.com/django/django/pull/2737

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:16>

Django

unread,
May 30, 2014, 6:18:10 AM5/30/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------

Comment (by danielsamuels):

That makes a lot more sense, thanks for putting the work in gyx1000.

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:17>

Django

unread,
Jun 4, 2014, 7:24:29 AM6/4/14
to django-...@googlegroups.com
#22684: SelectDateWidget's none_value is not changeable
-------------------------------+------------------------------------
Reporter: danielsamuels | Owner: gyx1000
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"7e2c87809ca601b7290203dd54ba3e9f90a702bd"]:
{{{
#!CommitTicketReference repository=""
revision="7e2c87809ca601b7290203dd54ba3e9f90a702bd"
Fixed #22684 -- Amended SelectDateWidget.empty_label to accept a tuple of
values.

Thanks danielsamuels for the report
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:18>

Reply all
Reply to author
Forward
0 new messages