mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
search: reduce user index size
This commit is contained in:
parent
12493cffca
commit
6382e631b6
@ -1,13 +1,13 @@
|
|||||||
{% load replace %}
|
{% load search_helpers %}
|
||||||
|
|
||||||
{% with first=object.first_name|safe|slugify last=object.last_name|safe|slugify nick=object.nick_name|default_if_none:""|safe|slugify %}
|
{% with first=object.first_name|safe|slugify last=object.last_name|safe|slugify nick=object.nick_name|default_if_none:""|safe|slugify %}
|
||||||
|
|
||||||
{{ first|replace:"|-| " }}
|
{{ first|replace:"|-| " }}
|
||||||
{{ last|replace:"|-| " }}
|
{{ last|replace:"|-| " }}
|
||||||
{{ nick|replace:"|-| " }}
|
{{ nick|replace:"|-| " }}
|
||||||
{{ first|cut:"-" }}
|
{% if first|count:"-" != 0 %}{{ first|cut:"-" }}{% endif %}
|
||||||
{{ last|cut:"-" }}
|
{% if last|count:"-" != 0 %}{{ last|cut:"-" }}{% endif %}
|
||||||
{{ nick|cut:"-" }}
|
{% if nick|count:"-" != 0 %}{{ nick|cut:"-" }}{% endif %}
|
||||||
{{ first|cut:"-" }}{{ last|cut:"-" }}
|
{{ first|cut:"-" }}{{ last|cut:"-" }}
|
||||||
|
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
@ -20,3 +20,8 @@ def replace(value, arg):
|
|||||||
raise TemplateSyntaxError("badly formatted argument")
|
raise TemplateSyntaxError("badly formatted argument")
|
||||||
|
|
||||||
return value.replace(arg[1], arg[2])
|
return value.replace(arg[1], arg[2])
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def count(value, arg):
|
||||||
|
return value.count(arg)
|
Loading…
Reference in New Issue
Block a user