1 2 3 4 5 6 7 8 9 | from django import template
register = template.Library()
@register.filter_function
def attr(obj, arg1):
att, value = arg1.split("=")
obj.field.widget.attrs[att] = value
return obj
|
More like this
- order_by template filter by marinho 4 years ago
- Advanced Search in django admin by visik7 1 year, 4 months ago
- BetterForm with fieldsets and row_attrs by carljm 3 years, 3 months ago
- Form row filter by kylefox 4 years, 3 months ago
- Custom CSS class in Form with template tag filter by kegan 2 years, 11 months ago
Comments