Tentative de corriger ce truc de cache

This commit is contained in:
Jean-Marie Favreau 2024-11-14 23:24:06 +01:00
parent df27949036
commit e767babd8e
4 changed files with 4 additions and 5 deletions

View File

@ -30,7 +30,7 @@
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout month user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %}
{% cache cache_timeout month user.is_authenticated calendar.firstdate filter.get_url LANGUAGE_CODE %}
<article>
<header>

View File

@ -39,7 +39,7 @@
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.to_str calendar.calendar_days_list|length LANGUAGE_CODE %}
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.get_url calendar.calendar_days_list|length LANGUAGE_CODE %}
<footer>
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view' date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour' date_pred.year date_pred.month date_pred.day %}{% endif %}" aria-label="dates précédentes" role="button">

View File

@ -23,10 +23,9 @@
{% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=0 %}
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout week user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %}
{% cache cache_timeout week user.is_authenticated calendar.firstdate filter.get_url LANGUAGE_CODE %}
<article>
<header>

View File

@ -322,7 +322,7 @@ class EventFilter(django_filters.FilterSet):
def to_str(self, prefix=''):
self.form.full_clean()
result = ' '.join([c.name for c in self.get_categories()] + [t for t in self.get_tags()] + [str(self.get_position()), str(self.get_radius())])
result = ' '.join([c.name for c in self.get_categories()] + [t for t in self.get_tags()] + ["~" + t for t in self.get_exclude_tags()] + [str(self.get_position()), str(self.get_radius())])
if len(result) > 0:
result = prefix + result
return result