Commits

Vladimir Korsun  committed 8781a02

Added is_widget filter

  • Participants
  • Parent commits 84b4160

Comments (0)

Files changed (1)

File src/templatetags/field_attributes.py

     """
     field.field.widget.attrs.update(kwargs)
     return {'field': field}
+
+
+@register.filter
+def is_widget(value, arg):
+    """
+    Check widget class name
+    """
+    return value.field.widget.__class__.__name__ == arg