From 97d1e4164bf5526c3b63570d27c8377b4dfcac46 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 13 Oct 2010 18:11:28 -0500 Subject: Connect post_save signals where they will always be triggered We need to do this in the models.py files, otherwise the post_save signal might not be connected right away on launch of the application. Move them over there, add a dispatch_uid so it only gets hooked up once, and do some other function moving around so we don't have circular imports. Signed-off-by: Dan McGee --- main/models.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main/models.py') diff --git a/main/models.py b/main/models.py index dc700fb..888f0b8 100644 --- a/main/models.py +++ b/main/models.py @@ -325,4 +325,10 @@ class TodolistPkg(models.Model): db_table = 'todolist_pkgs' unique_together = (('list','pkg'),) +# connect signals needed to keep cache in line with reality +from main.utils import refresh_package_latest +from django.db.models.signals import post_save +post_save.connect(refresh_package_latest, sender=Package, + dispatch_uid="main.models") + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b