##// END OF EJS Templates
Fixed issues with new images storage
neko259 -
r1591:af1d8bd1 default
parent child Browse files
Show More
@@ -146,5 +146,5 b' class Tag(models.Model, Viewable):'
146
146
147 def get_images(self):
147 def get_images(self):
148 return Attachment.objects.filter(
148 return Attachment.objects.filter(
149 post_attachments__thread__tags__in=[self]).filter(
149 attachment_posts__thread__tags__in=[self]).filter(
150 mimetype__in=FILE_TYPES_IMAGE).order_by('-post_images__pub_time') No newline at end of file
150 mimetype__in=FILE_TYPES_IMAGE).order_by('-attachment_posts__pub_time') No newline at end of file
@@ -142,7 +142,7 b' class Thread(models.Model):'
142 return self.get_replies().filter(
142 return self.get_replies().filter(
143 attachments__mimetype__in=FILE_TYPES_IMAGE)\
143 attachments__mimetype__in=FILE_TYPES_IMAGE)\
144 .annotate(images_count=Count(
144 .annotate(images_count=Count(
145 'attachments')).aggregate(Sum('images_count'))['images_count__sum']
145 'attachments')).aggregate(Sum('images_count'))['images_count__sum'] or 0
146
146
147 def can_bump(self) -> bool:
147 def can_bump(self) -> bool:
148 """
148 """
General Comments 0
You need to be logged in to leave comments. Login now