Hi,

I'd like to add some css to my field.label_tag() if the field is
required (so it generates class="required" as part of the <label>).
I'm using a straight forms.form_from_model but I can't really see how
it can be done in an intelligent manner. I've tried to figure out how
newforms-admin does it (in change_form.html, for example) -- but I
can't make it out. Any advice?

My template looks like this:

{% for field in form %}
<div class="form-row">
{{field.label_tag}}{{ field }}
</div>
{% endfor %}

I see that you can set attrs of a field to specify css--but can you do
this with a callback with form_from_model?

I see there's been a little discussion about css and widgets -- but no
resolution:
http://groups.google.com/group/django-users/browse_thread/thread/50d6963a3e91c3fc/9833404291ac4df7?lnk=gst&q=css+newforms+label&rnum=3#9833404291ac4df7

Cheers,

Allen


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to