# HG changeset patch # User neko259 # Date 2013-10-29 19:45:13 # Node ID 5b47aa61c04b66f869b037a24909e512d20f20bc # Parent c419aa115be96b690a0dbc6f867ca0492e07d268 Fixed cache issue with memcached diff --git a/boards/models.py b/boards/models.py --- a/boards/models.py +++ b/boards/models.py @@ -281,8 +281,9 @@ class Post(models.Model): replies = models.ManyToManyField('Post', symmetrical=False, null=True, blank=True, related_name='re+') - referenced_posts = models.ManyToManyField('Post', symmetrical=False, null=True, - blank=True, related_name='rfp+') + referenced_posts = models.ManyToManyField('Post', symmetrical=False, + null=True, + blank=True, related_name='rfp+') def __unicode__(self): return '#' + str(self.id) + ' ' + self.title + ' (' + \ @@ -317,7 +318,6 @@ class Post(models.Model): if self.can_bump(): self.bump_time = timezone.now() - def get_last_replies(self): if settings.LAST_REPLIES_COUNT > 0: reply_count = self.get_reply_count() @@ -325,8 +325,8 @@ class Post(models.Model): if reply_count > 0: reply_count_to_show = min(settings.LAST_REPLIES_COUNT, reply_count) - last_replies = self.replies.all().order_by('pub_time')[reply_count - - reply_count_to_show:] + last_replies = self.replies.all().order_by('pub_time')[ + reply_count - reply_count_to_show:] return last_replies @@ -336,7 +336,7 @@ class Post(models.Model): return self.tags.order_by('name') def get_cache_key(self): - return str(self.id) + str(self.last_edit_time) + return str(self.id) + str(self.last_edit_time.microsecond) class User(models.Model):