Estou querendo deixar o numero de telefone mais apresentável, fui usar @register.filter e nao consigo usar load na pagina html
views.py
from django import template
register = template.Library()
@register.filter(name='phone_format')
def phone_format(telephone):
clear_number = re.sub ('[^0-9]','"',(telephone))
formatted_number = re.sub((r'(\d{2})(\d{4,5}(\d{4})',r'(\1)\2-\3', clear_number))
return formatted_numbercontatos.html
{% extends 'base.html' %}
{%block conteudo%}
<h1 class="mt-5">Clientes</h1>
{% include 'includes/search_bar.html' %}
<a href="{% url 'dashboard' %}"><button type="button" class="btn btn-outline-secondary">Add Cliente</button></a>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Nome</th>
<th>Sobrenome</th>
<th>Telefone</th>
<th>Aniversário</th>
<th>Categoria</th>
</tr>
</thead>
<tbody>
{% for contato in contatos %}
{% load telephone %}
<tr>
<td>{{ contato.id }}</td>
<td>
<a href="{% url 'ver_contato' contato.id %}">{{ contato.name }}</a>
</td>
<td>{{ contato.surname }}</td>
<td>{{ telefone.telephone|telephone }}</td>
<td>{{ contato.birthday }}</td>
<td>{{ contato.categoria }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<nav aria-label="Page navigation example">
<ul class="pagination">
{% for pagina in contatos.paginator.page_range %}
{% if contatos.number == pagina %}
<li class="page-item active">
<a class="page-link" href="?p={{ pagina }}&termo={{ request.GET.termo }}">{{pagina}}</a>
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="?p={{ pagina }}&termo={{ request.GET.termo }}">{{pagina}}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
{%endblock%}TemplateSyntaxError at /contatos/ 'telephone' is not a registered tag library. Must be one of: 30 {% load telephone %}
ja mudei todos nomes possiveis do load e continua dando erro nele