Show More
@@ -87,8 +87,7 b' class Thread(models.Model):' | |||
|
87 | 87 | if reply_count > 0: |
|
88 | 88 | reply_count_to_show = min(settings.LAST_REPLIES_COUNT, |
|
89 | 89 | reply_count - 1) |
|
90 |
replies = self.replies |
|
|
91 | 'poster_user_agent', 'text_markup_type') | |
|
90 | replies = self.get_replies() | |
|
92 | 91 | last_replies = replies[reply_count - reply_count_to_show:] |
|
93 | 92 | |
|
94 | 93 | return last_replies |
@@ -107,7 +106,7 b' class Thread(models.Model):' | |||
|
107 | 106 | Gets sorted thread posts |
|
108 | 107 | """ |
|
109 | 108 | |
|
110 | query = self.replies.order_by('pub_time') | |
|
109 | query = self.replies.order_by('pub_time').prefetch_related('images') | |
|
111 | 110 | if view_fields_only: |
|
112 | 111 | query = query.defer('poster_user_agent', 'text_markup_type') |
|
113 | 112 | return query.all() |
@@ -161,4 +160,4 b' class Thread(models.Model):' | |||
|
161 | 160 | Gets opening post's pub time because thread does not have its own one. |
|
162 | 161 | """ |
|
163 | 162 | |
|
164 | return self.get_opening_post().pub_time No newline at end of file | |
|
163 | return self.get_opening_post().pub_time |
General Comments 0
You need to be logged in to leave comments.
Login now