Thank you Jashugan,

that's the way I went too but I thought there was a cleaner method,
right now it's working properly so I'll leave it alone but I'll have a
look later to see if I can improve that.

Bastien

On Jul 8, 6:09 pm, Jashugan <jashu...@gmail.com> wrote:
> On Jul 8, 5:26 am, Bastien <bastien.roche...@gmail.com> wrote:
>
> > I would like to
> > have the control of every checkbox the same way I can control the
> > fields of a form
>
> I think the easiest way to do this is to create a custom widget.
> Here's what I did:
>
> class CheckboxSelectMultiple(widgets.CheckboxSelectMultiple):
>   """Simply adds a class to the ul element, which allows the CSS to
> select it."""
>   def render(self, *args, **kwargs):
>     output = super(CheckboxSelectMultiple, self).render(*args,
> **kwargs)
>     return mark_safe(output.replace(u'<ul>', u'<ul class="checkbox-
> select">'))
>
> You can modify the render method to produce the HTML output you want.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to