Django: Ticket #16575: SelectDateWidget should have possibility to have more custom configurationshttps://code.djangoproject.com/ticket/16575
<p>
It is possible to add some extra configurations to SelectDateWidget constructor.
There was a need for me to use custom "empty" value for each field and custom &lt;select&gt; order, not assigned with settings.
And that's what was done. I'm attouching my own version of forms.extras.widgets module.
It just differs in described above functionality and completely backward-compatible.
Also current v1.3 code was looking dirty for me, so most such places were rewritten. Hope this version will get into repository
</p>
en-usDjangohttps://www.djangoproject.com/s/img/site/hdr_logo.gifhttps://code.djangoproject.com/ticket/16575
Trac 1.0.7anonymousFri, 05 Aug 2011 10:32:43 GMTattachment sethttps://code.djangoproject.com/ticket/16575
https://code.djangoproject.com/ticket/16575
<ul>
<li><strong>attachment</strong>
set to <em>widgets.py</em>
</li>
</ul>
TicketfoobarriorFri, 05 Aug 2011 10:39:38 GMTeasy changed; needs_better_patch, needs_tests, needs_docs sethttps://code.djangoproject.com/ticket/16575#comment:1
https://code.djangoproject.com/ticket/16575#comment:1
<ul>
<li><strong>needs_better_patch</strong>
unset
</li>
<li><strong>easy</strong>
set
</li>
<li><strong>needs_tests</strong>
unset
</li>
<li><strong>needs_docs</strong>
unset
</li>
</ul>
TicketfoobarriorFri, 05 Aug 2011 11:18:05 GMTattachment sethttps://code.djangoproject.com/ticket/16575
https://code.djangoproject.com/ticket/16575
<ul>
<li><strong>attachment</strong>
set to <em>widgets.2.py</em>
</li>
</ul>
<p>
the same, only removed pep8 utility's errors and warnings
</p>
TicketbpeschierSat, 06 Aug 2011 09:14:02 GMTneeds_docs, stage, needs_tests, needs_better_patch changedhttps://code.djangoproject.com/ticket/16575#comment:2
https://code.djangoproject.com/ticket/16575#comment:2
<ul>
<li><strong>needs_docs</strong>
set
</li>
<li><strong>stage</strong>
changed from <em>Unreviewed</em> to <em>Accepted</em>
</li>
<li><strong>needs_tests</strong>
set
</li>
<li><strong>needs_better_patch</strong>
set
</li>
</ul>
<p>
Hi, thanks for the contribution! A bit of cleanup and simple extra features are always welcome.
</p>
<p>
There are however a couple of issues with the patch:
</p>
<ul><li>Actually, it's not a patch; could you create a diff from the current trunk?
</li><li>Make sure there are no leftover prints or other debug-statements.
</li><li>Other date widgets fall back to default date formats (see DateInput for example) and it is nice to do the same here.
</li><li>The cleanup makes the code crisper, but it also makes the helper functions on top a bit harder to read, could you document them?
</li><li>The new features should be documented and check whether there are tests for the widget, if they still work and whether or not they need updating.
</li></ul>
TicketcalebsSun, 13 Nov 2011 20:59:00 GMThttps://code.djangoproject.com/ticket/16575#comment:3
https://code.djangoproject.com/ticket/16575#comment:3
<p>
I made foobarrior's changes into a git diff off of the 1.3.1 trunc with a few other changes including:
</p>
<ul><li>Removal of stray prints and other debug statements.
</li><li>Adding _has_changed back in. (Not certain about what to do with this method)
</li><li>Consolidated the two helper functions into one and added a docstring.
</li><li>Fallback to defaults based on locale
</li></ul><p>
If L10N is False, the changes in this diff make the select widgets order by year, month, day. I'm not sure if this should fall back to US order (d/m/Y) as before, or UTC (Y/m/d).
</p>
<p>
Tests are still needed and this diff causes a failure in line 92 of FormsExtraTestCase. However, should the test be amended to use UTC or en-US in the event of no L10N?
</p>
TicketcalebsSun, 13 Nov 2011 20:59:25 GMTattachment sethttps://code.djangoproject.com/ticket/16575
https://code.djangoproject.com/ticket/16575
<ul>
<li><strong>attachment</strong>
set to <em>date_format-select_date_widget.2.diff</em>
</li>
</ul>
TicketcalebsSun, 13 Nov 2011 20:59:36 GMTattachment sethttps://code.djangoproject.com/ticket/16575
https://code.djangoproject.com/ticket/16575
<ul>
<li><strong>attachment</strong>
set to <em>date_format-select_date_widget.diff</em>
</li>
</ul>
TicketKamuSun, 09 Jun 2013 14:43:19 GMTversion deletedhttps://code.djangoproject.com/ticket/16575#comment:4
https://code.djangoproject.com/ticket/16575#comment:4
<ul>
<li><strong>version</strong>
<em>1.3</em> deleted
</li>
</ul>
TickettimoFri, 20 Sep 2013 11:57:18 GMTeasy changedhttps://code.djangoproject.com/ticket/16575#comment:5
https://code.djangoproject.com/ticket/16575#comment:5
<ul>
<li><strong>easy</strong>
unset
</li>
</ul>
Ticket