Skip to content
Snippets Groups Projects
Commit e00b840f authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[ui][registration][templatetags] Pre-commit cleanup

parent 72572d10
No related branches found
No related tags found
2 merge requests!367Cleanup ui registration,!342Django 3 migration
......@@ -27,15 +27,18 @@
from django import template
register = template.Library()
@register.filter
def tabindex(value, index):
"""Add a tabindex attribute to the widget for a bound field."""
value.field.widget.attrs['tabindex'] = index
value.field.widget.attrs["tabindex"] = index
return value
@register.filter(name='addclass')
@register.filter(name="addclass")
def addclass(field, kls):
"""Adds a class to the widget"""
return field.as_widget(attrs={"class":kls})
"""Adds a class to the widget"""
return field.as_widget(attrs={"class": kls})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment