[Django] #16575: SelectDateWidget should have possibility to have more custom configurations

12 views
Skip to first unread message

Django

unread,
Aug 5, 2011, 6:32:04 AM8/5/11
to django-...@googlegroups.com
#16575: SelectDateWidget should have possibility to have more custom configurations
------------------------------+----------------------------
Reporter: foobarrior | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Forms
Version: 1.3 | Severity: Normal
Keywords: SelectDateWidget | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
------------------------------+----------------------------
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 <select> 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

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

Django

unread,
Aug 5, 2011, 6:39:38 AM8/5/11
to django-...@googlegroups.com
#16575: SelectDateWidget should have possibility to have more custom configurations
---------------------------------------+----------------------------------
Reporter: foobarrior | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Forms
Version: 1.3 | Severity: Normal
Resolution: | Keywords: SelectDateWidget
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
---------------------------------------+----------------------------------
Changes (by foobarrior):

* needs_better_patch: => 0
* easy: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


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

Django

unread,
Aug 6, 2011, 5:14:02 AM8/6/11
to django-...@googlegroups.com
#16575: SelectDateWidget should have possibility to have more custom configurations
---------------------------------------+----------------------------------
Reporter: foobarrior | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Forms
Version: 1.3 | Severity: Normal
Resolution: | Keywords: SelectDateWidget
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 1
Patch needs improvement: 1 | Easy pickings: 1
UI/UX: 0 |
---------------------------------------+----------------------------------
Changes (by bpeschier):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
* needs_tests: 0 => 1
* needs_docs: 0 => 1


Comment:

Hi, thanks for the contribution! A bit of cleanup and simple extra
features are always welcome.

There are however a couple of issues with the patch:

* Actually, it's not a patch; could you create a diff from the current
trunk?
* Make sure there are no leftover prints or other debug-statements.
* Other date widgets fall back to default date formats (see DateInput for
example) and it is nice to do the same here.
* The cleanup makes the code crisper, but it also makes the helper
functions on top a bit harder to read, could you document them?
* 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.

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

Django

unread,
Nov 13, 2011, 3:59:00 PM11/13/11
to django-...@googlegroups.com
#16575: SelectDateWidget should have possibility to have more custom configurations
----------------------------------+------------------------------------
Reporter: foobarrior | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.3
Severity: Normal | Resolution:
Keywords: SelectDateWidget | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
----------------------------------+------------------------------------

Comment (by calebs):

I made foobarrior's changes into a git diff off of the 1.3.1 trunc with a
few other changes including:

* Removal of stray prints and other debug statements.
* Adding _has_changed back in. (Not certain about what to do with this
method)
* Consolidated the two helper functions into one and added a docstring.
* Fallback to defaults based on locale

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).

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?

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

Django

unread,
Jun 9, 2013, 10:43:19 AM6/9/13
to django-...@googlegroups.com
#16575: SelectDateWidget should have possibility to have more custom configurations
----------------------------------+------------------------------------

Reporter: foobarrior | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version:

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

* version: 1.3 =>


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

Django

unread,
Sep 20, 2013, 7:57:19 AM9/20/13
to django-...@googlegroups.com
#16575: SelectDateWidget should have possibility to have more custom configurations
----------------------------------+------------------------------------

Reporter: foobarrior | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version:
Severity: Normal | Resolution:
Keywords: SelectDateWidget | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

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

* easy: 1 => 0


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

Django

unread,
Jan 11, 2017, 8:05:02 AM1/11/17
to django-...@googlegroups.com
#16575: Allow specifying custom "empty" values for SelectDateWidget
----------------------------------+-------------------------------------
Reporter: foobarrior | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version:
Severity: Normal | Resolution: duplicate

Keywords: SelectDateWidget | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

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

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


Comment:

Duplicate of #22684. Use `SelectDateWidget.empty_label` in Django 1.8+.

Reply all
Reply to author
Forward
0 new messages