You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_input_classes should return field to use it as a filter.
--- a/bootstrapform/templatetags/bootstrap.py+++ b/bootstrapform/templatetags/bootstrap.py@@ -45,20 +45,21 @@ def bootstrap_horizontal(element, label_cols='col-sm-2 col-lg-2'):
return render(element, markup_classes)
@register.filter
def add_input_classes(field):
if not is_checkbox(field) and not is_multiple_checkbox(field) \
and not is_radio(field) and not is_file(field):
field_classes = field.field.widget.attrs.get('class', '')
field_classes += ' form-control'
field.field.widget.attrs['class'] = field_classes
+ return field
I would open one-line PR if you want. Thanks.
The text was updated successfully, but these errors were encountered:
add_input_classes
should returnfield
to use it as a filter.I would open one-line PR if you want. Thanks.
The text was updated successfully, but these errors were encountered: