summaryrefslogtreecommitdiffstats
path: root/news
diff options
context:
space:
mode:
Diffstat (limited to 'news')
-rw-r--r--news/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/news/models.py b/news/models.py
index 6c8a703..e2486c9 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: