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 5 years ago
- Cookie based flash errors and notices (a la Rails) by alexk 4 years, 8 months ago
- Templatetag startswith + message tuned by io_error 4 years, 11 months ago
- Admin Input Field Character Count via jQuery by joshman 4 years, 5 months ago
- Git Revision Template Tag by sbaechler 6 months, 1 week ago
Comments