Show More
@@ -240,11 +240,7 b' class Post(models.Model):' | |||
|
240 | 240 | |
|
241 | 241 | def get_images_count(self): |
|
242 | 242 | images_count = 1 if self.image else 0 |
|
243 | ||
|
244 | # TODO Use query here | |
|
245 | for reply in self.replies: | |
|
246 | if reply.image: | |
|
247 | images_count += 1 | |
|
243 | images_count += self.replies.filter(image_width__gt=0).count() | |
|
248 | 244 | |
|
249 | 245 | return images_count |
|
250 | 246 |
General Comments 0
You need to be logged in to leave comments.
Login now