Ticket #9228: sites_v3.diff
File sites_v3.diff, 1022 bytes (added by , 16 years ago) |
---|
-
django/contrib/sites/tests.py
8 8 >>> isinstance(s, Site) 9 9 True 10 10 11 >>> s.domain 12 u"example.com" 13 >>> s.domain = "example.org" 14 >>> s.save() 15 >>> s = Site.objects.get_current() 16 >>> s.domain 17 u"example.org" 11 18 >>> s.delete() 12 19 >>> Site.objects.get_current() 13 20 Traceback (most recent call last): -
django/contrib/sites/models.py
41 41 42 42 def __unicode__(self): 43 43 return self.domain 44 44 45 def save(self, **kwargs): 46 super(Site, self).save(**kwargs) 47 try: 48 del(SITE_CACHE[self.pk]) 49 except KeyError: 50 pass 51 45 52 def delete(self): 46 53 pk = self.pk 47 54 super(Site, self).delete()