Use cachalot to invalidate caches

This commit is contained in:
2023-02-11 17:24:13 +00:00
parent 9fcf5041f0
commit 4ead6ff7c1
5 changed files with 9 additions and 14 deletions

View File

@@ -1,7 +1,8 @@
{% load static %}
{% load cache %}
{% cache 600 objects_plans request.user.id plans %}
{% load cachalot cache %}
{% get_last_invalidation 'core.Plan' as last %}
{% cache 600 objects_plans request.user.id plans last %}
{% for plan in plans %}
<div class="box">
<article class="media">

View File

@@ -1,6 +1,8 @@
{% load cache %}
{% load cachalot cache %}
{% get_last_invalidation 'core.NotificationRule' as last %}
{% include 'mixins/partials/notify.html' %}
{% cache 600 objects_rules request.user.id object_list %}
{% cache 600 objects_rules request.user.id object_list last %}
<table
class="table is-fullwidth is-hoverable"
hx-target="#{{ context_object_name }}-table"
@@ -18,7 +20,6 @@
<th>topic</th>
<th>enabled</th>
<th>data length</th>
<th>match</th>
<th>actions</th>
</thead>
{% for item in object_list %}
@@ -42,7 +43,6 @@
{% endif %}
</td>
<td>{{ item.data|length }}</td>
<td>{{ item.matches }}</td>
<td>
<div class="buttons">
<button