Hi,

I want to differentiate CSS style of fields <label> from the style of
RadioSelects <label> elements (as rendered through
RadioFieldRenderer).
Immediate action: I could create my RadioFieldRenderer/RadioInput
classes to display inner labels as <label class="foo">.

But (and this is mostly my point of raising the issue), I was also
looking at a way to provide attributes (CSS classes, inline style, id,
etc) to the <label> element rendered directly by Django (though
{{form.as_ul}} or {{field.label_tag}} for instance).

Digging the code, I found the BoundField class with its method
label_tag. Problems:
- this method is either called from form.as_ul() (or as_p(), etc)
without passing attrs parameters
- or it can be called directly from a template
({{myfield.label_tag}}), but without the ability to pass extra
arguments.

Basically I am stuck wondering how to set attributes on a Field's
rendered label, without having to hardcode it in every form template,
or subclassing the whole Form/BoundField classes...

Any direction you could give me? Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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