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 3 years, 9 months ago
- Advanced Search in django admin by visik7 1 year ago
- BetterForm with fieldsets and row_attrs by carljm 3 years ago
- Form row filter by kylefox 3 years, 12 months ago
- Custom CSS class in Form with template tag filter by kegan 2 years, 7 months ago
Comments