unlazy clean_string and add unlazy_filter
gitea/imio-teleservices-templatetags/pipeline/head This commit looks good Details

This commit is contained in:
Nicolas Selva 2023-03-31 12:56:25 +02:00
parent 7e35838003
commit 58cdf40f9c
1 changed files with 9 additions and 0 deletions

View File

@ -21,8 +21,17 @@ def unlazy_date(fdate):
return fdate
@register.filter
def unlazy_filter(value):
if isinstance(value, LazyDateObject):
return str(unlazy(value))
else:
return value
@register.filter
def clean_string(value):
value = unlazy_filter(value)
return value.replace(" ", "").replace(".", "").replace("-", "")