##// END OF EJS Templates
Fixed issue with random images
neko259 -
r1592:f712e495 default
parent child Browse files
Show More
@@ -25,9 +25,9 b' class AttachmentManager(models.Manager):'
25
25
26 def get_random_images(self, count, tags=None):
26 def get_random_images(self, count, tags=None):
27 images = self.filter(mimetype__in=FILE_TYPES_IMAGE).exclude(
27 images = self.filter(mimetype__in=FILE_TYPES_IMAGE).exclude(
28 post_attachments__thread__status=STATUS_ARCHIVE)
28 attachment_posts__thread__status=STATUS_ARCHIVE)
29 if tags is not None:
29 if tags is not None:
30 images = images.filter(post_attachments__threads__tags__in=tags)
30 images = images.filter(attachment_posts__threads__tags__in=tags)
31 return images.order_by('?')[:count]
31 return images.order_by('?')[:count]
32
32
33
33
General Comments 0
You need to be logged in to leave comments. Login now