Hi,

The ``attrs`` attribute of a widget allows to define the html attributes. 
For example, setting it to ``widget.attrs['class'] = 'class1 class2'`` will 
add ``class="class1 class2"`` on the rendered widget.

However, how can I set them based on the data? I display an update form and 
I'd like to change the CSS class based on the data that is going to be 
displayed when the form is rendered.

Where could I check for the data in order to change the ``attrs`` property 
of the widget before it is rendered?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3569acd7-5bec-4df9-8960-4952b3fee8fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to