This is caused in django.forms.widgets, line 759.
I propose to delete lines 759 and 777 and on line 777:
if len(output):
output.insert(0, '<ul>')
output.append('</ul>')
--
Ticket URL: <https://code.djangoproject.com/ticket/20655>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/20655#comment:1>
Comment (by caroline@…):
* That should say and "<ul></ul>" in the final HTML messes up the display
of the form.
--
Ticket URL: <https://code.djangoproject.com/ticket/20655#comment:2>
* status: new => closed
* component: Uncategorized => Forms
* resolution: => wontfix
* cc: bmispelon@… (added)
* type: Bug => Cleanup/optimization
Comment:
Hi,
An empty `<ul>` is valid markup so it shouldn't mess up the displaying of
a form.
This might be a CSS issue instead.
I'm -1 on the idea of changing the behavior of `CheckboxSelectMultiple`
for the following reasons:
1) Backwards compatibility issues: we can't simply change this behavior
since other users are probably relying on it.
2) Consistency with other widgets: a `Select` widgets renders as an empty
`<select>` when its `choices` are empty, not an empty string.
3) It shouldn't be hard to implement a custom widget if you wanted this
behavior. With the refactor introduced in commit
9ac4dbd7b53d187ca54f28e247d3a120660938ca, all you'd need to do would be to
write a custom `renderer` for the widget.
For these reasons, I'm going to close this as `wontfix`.
Don't hesitate to reopen this ticket if you disagree with me and if you
have arguments that address the concerns I've raised.
There's also the django-developers mailing list where you can start a
discussion about this issue: http://groups.google.com/group/django-
developers.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/20655#comment:3>