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