comparison gpp/bulletins/models.py @ 213:65016249bf35

See #31; undid attempts to clear template tag caching when saving news and bulletins, as we don't know the cache key (it is mangled).
author Brian Neal <bgneal@gmail.com>
date Mon, 10 May 2010 02:58:19 +0000
parents 5c889b587416
children
comparison
equal deleted inserted replaced
212:fad7548b7f6e 213:65016249bf35
3 """ 3 """
4 4
5 import datetime 5 import datetime
6 from django.db import models 6 from django.db import models
7 from django.db.models import Q 7 from django.db.models import Q
8 from django.core.cache import cache
9 8
10 9
11 class BulletinManager(models.Manager): 10 class BulletinManager(models.Manager):
12 """Manager for the Bulletin model.""" 11 """Manager for the Bulletin model."""
13 12
35 class Meta: 34 class Meta:
36 ordering = ('-start_date', ) 35 ordering = ('-start_date', )
37 36
38 def __unicode__(self): 37 def __unicode__(self):
39 return self.title 38 return self.title
40
41 def save(self, *args, **kwargs):
42 super(Bulletin, self).save(*args, **kwargs)
43 cache.delete('home_bulletins')
44
45