2017-06-12 01:51:10 +02:00
|
|
|
import re
|
|
|
|
|
2016-08-02 10:40:46 +02:00
|
|
|
from django import template
|
|
|
|
from django.utils.html import escape
|
|
|
|
from django.utils.safestring import mark_safe
|
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
from ..utils import to_ukf
|
|
|
|
|
2016-08-02 10:40:46 +02:00
|
|
|
register = template.Library()
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
register.filter("ukf", to_ukf)
|
2017-06-12 01:51:10 +02:00
|
|
|
|
2017-03-15 20:11:38 +01:00
|
|
|
|
2016-08-20 01:20:06 +02:00
|
|
|
@register.filter()
|
2017-06-12 01:51:10 +02:00
|
|
|
def widget_type(field):
|
|
|
|
return field.field.widget.__class__.__name__
|
2017-05-19 13:42:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
@register.filter()
|
2017-06-12 01:51:10 +02:00
|
|
|
def slice(l, start, end=None):
|
|
|
|
if end is None:
|
|
|
|
end = start
|
|
|
|
start = 0
|
|
|
|
return l[start:end]
|