summaryrefslogtreecommitdiff
path: root/news/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'news/models.py')
-rw-r--r--news/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/news/models.py b/news/models.py
index 6c8a7039..e2486c96 100644
--- a/news/models.py
+++ b/news/models.py
@@ -23,4 +23,10 @@ class News(models.Model):
get_latest_by = 'postdate'
ordering = ['-postdate']
+# connect signals needed to keep cache in line with reality
+from main.utils import refresh_news_latest
+from django.db.models.signals import post_save
+post_save.connect(refresh_news_latest, sender=News,
+ dispatch_uid="news.models")
+
# vim: set ts=4 sw=4 et: