Show More
@@ -281,7 +281,8 b' class Post(models.Model):' | |||
|
281 | 281 | |
|
282 | 282 | replies = models.ManyToManyField('Post', symmetrical=False, null=True, |
|
283 | 283 | blank=True, related_name='re+') |
|
284 |
referenced_posts = models.ManyToManyField('Post', symmetrical=False, |
|
|
284 | referenced_posts = models.ManyToManyField('Post', symmetrical=False, | |
|
285 | null=True, | |
|
285 | 286 | blank=True, related_name='rfp+') |
|
286 | 287 | |
|
287 | 288 | def __unicode__(self): |
@@ -317,7 +318,6 b' class Post(models.Model):' | |||
|
317 | 318 | if self.can_bump(): |
|
318 | 319 | self.bump_time = timezone.now() |
|
319 | 320 | |
|
320 | ||
|
321 | 321 | def get_last_replies(self): |
|
322 | 322 | if settings.LAST_REPLIES_COUNT > 0: |
|
323 | 323 | reply_count = self.get_reply_count() |
@@ -325,8 +325,8 b' class Post(models.Model):' | |||
|
325 | 325 | if reply_count > 0: |
|
326 | 326 | reply_count_to_show = min(settings.LAST_REPLIES_COUNT, |
|
327 | 327 | reply_count) |
|
328 |
last_replies = self.replies.all().order_by('pub_time')[ |
|
|
329 |
|
|
|
328 | last_replies = self.replies.all().order_by('pub_time')[ | |
|
329 | reply_count - reply_count_to_show:] | |
|
330 | 330 | |
|
331 | 331 | return last_replies |
|
332 | 332 | |
@@ -336,7 +336,7 b' class Post(models.Model):' | |||
|
336 | 336 | return self.tags.order_by('name') |
|
337 | 337 | |
|
338 | 338 | def get_cache_key(self): |
|
339 | return str(self.id) + str(self.last_edit_time) | |
|
339 | return str(self.id) + str(self.last_edit_time.microsecond) | |
|
340 | 340 | |
|
341 | 341 | |
|
342 | 342 | class User(models.Model): |
General Comments 0
You need to be logged in to leave comments.
Login now