diff options
author | Dan McGee <dan@archlinux.org> | 2010-10-13 18:11:28 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-10-13 18:11:28 -0500 |
commit | 97d1e4164bf5526c3b63570d27c8377b4dfcac46 (patch) | |
tree | 49b42c12f2ffc7256e1e24abe87100e03648bde5 /main/models.py | |
parent | 0c65360e6ccf812ae319b6a70e25804a224cca99 (diff) |
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 <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r-- | main/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py index dc700fbf..888f0b8d 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: |