Example code that I now use to "hack" the class into the <ul>. The example
code is used in the context of mezzanine/grappelli, which provides a nice
CSS with ul.checkboxlist that works well for admin pages.
{{{
class CheckboxSelectMultipleRenderer(CheckboxFieldRenderer):
def render(self):
result = super(CheckboxSelectMultipleRenderer, self).render()
return mark_safe(re.sub("<ul id", '<ul class="checkboxlist" id',
result, count=1))
class CheckboxSelectMultipleCss(CheckboxSelectMultiple):
renderer = CheckboxSelectMultipleRenderer
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25495>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* easy: 1 => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I guess template-based widget rendering would add some flexibility here
(#15667). That feature is expected in Django 1.10. Do you think that would
meet your use case?
--
Ticket URL: <https://code.djangoproject.com/ticket/25495#comment:1>
* status: new => closed
* resolution: => wontfix
Comment:
Feel free to reopen if you feel that other ticket doesn't offer a good
solution to this issue and you have an alternate proposal for what the API
could look like.
--
Ticket URL: <https://code.djangoproject.com/ticket/25495#comment:2>