--
Ticket URL: <https://code.djangoproject.com/ticket/22684>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: danielsamuels (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:1>
* easy: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:2>
* owner: nobody => gyx1000
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:3>
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>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:5>
* 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>
Comment (by gyx1000):
Thanks for your comments on the PR.
I make needed changes.
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:7>
* 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>
Comment (by gyx1000):
I have change the documentation with this new feature.
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:9>
Comment (by claudep):
@danielsamuels: does the proposed implementation fulfill your use case?
--
Ticket URL: <https://code.djangoproject.com/ticket/22684#comment:10>
* 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>
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>
* 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>
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>
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>
* 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>
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>
* 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>