On Jul 8, 5:26 am, Bastien <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to