unlazy clean_string and add unlazy_filter
gitea/imio-teleservices-templatetags/pipeline/head This commit looks good
Details
gitea/imio-teleservices-templatetags/pipeline/head This commit looks good
Details
This commit is contained in:
parent
7e35838003
commit
58cdf40f9c
|
@ -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("-", "")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue