Re: [Django] #4592: Make CheckboxSelectMultiple more like RadioSelect

11 views
Skip to first unread message

Django

unread,
Jun 4, 2011, 7:17:15 AM6/4/11
to django-...@googlegroups.com
#4592: Make CheckboxSelectMultiple more like RadioSelect
------------------------------------------------+-------------------------
Reporter: Scott Sinclair | Owner: nobody
Type: Cleanup/optimization | Status: new
Milestone: | Component: Forms
Version: SVN | Severity: Normal
Resolution: | Keywords: feature
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
------------------------------------------------+-------------------------
Changes (by lupino):

* easy: => 0


Comment:

Furthermore, I'd like to add that the current hard-coded output is not
consistent with the output of someform.as_ul, which renders checkboxes
like

{{{
<li><label for="id_blubb">Blubb:</label> <input id="id_blubb"
type="checkbox" name="mobil" value="1" /></li>
}}}
whereas the format of the list elements in CheckboxSelectMultiple is
{{{
<li><label for="id_blubb_0"><input type="checkbox" name="blargh" value="1"
id="id_blubb_0" /> Blubb </label></li>
}}}

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

Django

unread,
Apr 12, 2013, 8:15:56 PM4/12/13
to django-...@googlegroups.com
#4592: Make CheckboxSelectMultiple more like RadioSelect
-------------------------------------+-------------------------------------
Reporter: Scott Sinclair | Owner: bmispelon
Type: | Status: assigned
Cleanup/optimization | Version: master
Component: Forms | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: feature | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* cc: bmispelon@… (added)
* owner: nobody => bmispelon
* status: new => assigned
* needs_better_patch: 1 => 0


Comment:

I've brought Matt McClanahan's old patch up to date and added some
documentation [1]

The tests pass without modification so this change should be completely
backwards-compatible (I was actually surprised at how well it worked).

One thing to note is the disappearance of
`django.forms.widgets.RadioInput` which was not part of the public API
(it's not in `__all__` and was not documented anywhere).
If needed, it would be possible to re-introduce it as an alias of the new
`RadioChoiceInput` with a deprecationwarning.

In my branch, the commit for this ticket depends on two other ones: #4117
and #19874 which are somewhat related.

[1] https://github.com/bmispelon/django/compare/ticket-4592

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

Django

unread,
Apr 13, 2013, 8:01:49 AM4/13/13
to django-...@googlegroups.com
#4592: Make CheckboxSelectMultiple more like RadioSelect
-------------------------------------+-------------------------------------
Reporter: Scott Sinclair | Owner: bmispelon
Type: | Status: assigned
Cleanup/optimization | Version: master
Component: Forms | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: feature | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by bmispelon):

Here's the link to the pull request:
https://github.com/django/django/pull/1011/files

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

Django

unread,
Apr 13, 2013, 8:04:36 AM4/13/13
to django-...@googlegroups.com
#4592: Make CheckboxSelectMultiple more like RadioSelect
-------------------------------------+-------------------------------------
Reporter: Scott Sinclair | Owner: bmispelon
Type: | Status: assigned
Cleanup/optimization | Version: master
Component: Forms | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: feature | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by claudep):

Replying to [comment:16 bmispelon]:


> One thing to note is the disappearance of
`django.forms.widgets.RadioInput` which was not part of the public API
(it's not in `__all__` and was not documented anywhere).
> If needed, it would be possible to re-introduce it as an alias of the
new `RadioChoiceInput` with a deprecationwarning.

Yes, I think that adding a deprecation shim for `RadioInput` would be a
good thing, as it does not cost us much. See
http://djangosnippets.org/snippets/2159/ for an example of a `RadioInput`
usage. Apart from that, the patch is RFC.

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

Django

unread,
Apr 13, 2013, 10:39:46 AM4/13/13
to django-...@googlegroups.com
#4592: Make CheckboxSelectMultiple more like RadioSelect
-------------------------------------+-------------------------------------
Reporter: Scott Sinclair | Owner: bmispelon
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Forms | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: feature | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

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


Comment:

In [changeset:"9ac4dbd7b53d187ca54f28e247d3a120660938ca"]:
{{{
#!CommitTicketReference repository=""
revision="9ac4dbd7b53d187ca54f28e247d3a120660938ca"
Fixed #4592: Made CheckboxSelectMultiple more like RadioSelect

I refactored RadioSelect and CheckboxSelectMultiple to
make them inherit from a base class, allowing them to share
the behavior of being able to iterate over their subwidgets.

Thanks to Matt McClanahan for the initial patch and to
Claude Paroz for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/4592#comment:19>

Django

unread,
Mar 21, 2014, 11:18:59 AM3/21/14
to django-...@googlegroups.com
#4592: Make CheckboxSelectMultiple more like RadioSelect
-------------------------------------+-------------------------------------
Reporter: Scott Sinclair | Owner: bmispelon
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Forms | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: feature | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"797d742662a47417ab875b7a1f5d7919caf5363f"]:
{{{
#!CommitTicketReference repository=""
revision="797d742662a47417ab875b7a1f5d7919caf5363f"
Removed django.forms.widgets.RadioInput per deprecation timeline.

refs #4592.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/4592#comment:20>

Reply all
Reply to author
Forward
0 new messages