pydanny/django-uni-form — Issue #111: Field's css classes are removed after applying with_class filter
Author: restless
Created: 2011-10-11 09:20:19+00:00
State: open

Sample code:

class SomeForm(forms.Form):
# fields definitions here
def __init__(self, *args, **kwargs):
super(SomeForm, self).__init__(*args, **kwargs)
self.fields['somefield'].widget.attrs['class'] = 'some_class'

After "uniforming" this form (adding uni_form's helper etc.) 'some_class' css class is removed from attrs.

This behaviour is caused by "uni_form.templatetags.uni_form_field.with_class" filter that overwrites attrs['class'] attribute. The filter is applied in field.html default template.

This issue was discussed at #106.