Commits

Anonymous committed 90158f2

Updated to new buffered_property

  • Participants
  • Parent commits fd068c9

Comments (0)

Files changed (1)

File gnocchi/forum/models.py

 from django.db import models
 from datetime import datetime
 
-from gnocchi.tools.utils import CachedProperty
+from gnocchi.tools.cache import buffered_property
 
 THREAD_STATE_CHOICES = (
     ('open', 'Open to General postings.'),
         return u'[%s] %s' % (self.category, self.title,)
     @models.permalink
     def get_absolute_url(self):
-        return (
-            'forum-detail',
-            (),
-            {'forum_slug': self.slug, 'forum_id': self.pk},
-        )
+        return ('forum-detail', (), {
+            'forum_slug': self.slug,
+            'forum_id': self.pk
+        })
 
 class Thread(models.Model):
     '''List of posts within a Topic'''
             'thread_id': self.id,
         }
 
-    @CachedProperty
+    @buffered_property
     def post_count(self):
         return self.post_set.aggregate(
             post_count=models.Count('id')
         )['post_count']
 
-    @CachedProperty
+    @buffered_property
     def last_post(self):
         try:
             return self.post_set.order_by('-created')[0]