##// END OF EJS Templates
Added ordering to replies.
neko259 -
r215:fd98bd81 default
parent child Browse files
Show More
@@ -110,7 +110,7 b' class PostManager(models.Manager):'
110
110
111 if opening_post.replies:
111 if opening_post.replies:
112 thread = [opening_post]
112 thread = [opening_post]
113 thread.extend(opening_post.replies.all())
113 thread.extend(opening_post.replies.all().order_by('pub_time'))
114
114
115 return thread
115 return thread
116
116
@@ -269,7 +269,7 b' class Post(models.Model):'
269 if reply_count > 0:
269 if reply_count > 0:
270 reply_count_to_show = min(settings.LAST_REPLIES_COUNT,
270 reply_count_to_show = min(settings.LAST_REPLIES_COUNT,
271 reply_count)
271 reply_count)
272 last_replies = self.replies.all()[reply_count -
272 last_replies = self.replies.all().order_by('pub_time')[reply_count -
273 reply_count_to_show:]
273 reply_count_to_show:]
274
274
275 return last_replies
275 return last_replies
General Comments 0
You need to be logged in to leave comments. Login now