From 77842a6c76095277b024505708bf528d455b9c89 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 7 Apr 2011 16:52:52 -0500 Subject: Consolidate caching black magic Get the stuff used to retrieve and refresh the latest date values all in the same place, and make it a bit more beautiful by refactoring it all into a common set of methods. Signed-off-by: Dan McGee --- news/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'news') diff --git a/news/models.py b/news/models.py index 17d51de..5e46751 100644 --- a/news/models.py +++ b/news/models.py @@ -36,10 +36,10 @@ def set_news_fields(sender, **kwargs): now.strftime('%Y-%m-%d'), news.get_absolute_url()) # connect signals needed to keep cache in line with reality -from main.utils import refresh_news_latest +from main.utils import refresh_latest from django.db.models.signals import pre_save, post_save -post_save.connect(refresh_news_latest, sender=News, +post_save.connect(refresh_latest, sender=News, dispatch_uid="news.models") pre_save.connect(set_news_fields, sender=News, dispatch_uid="news.models") -- cgit v1.2.3-24-g4f1b