random.sample don't take sets anymore
This commit is contained in:
parent
4ff97d09fa
commit
3b1056b3ae
1 changed files with 1 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ class Gallery(models.Model):
|
||||||
photo_set = self.photos.filter(is_public=True)
|
photo_set = self.photos.filter(is_public=True)
|
||||||
else:
|
else:
|
||||||
photo_set = self.photos
|
photo_set = self.photos
|
||||||
return random.sample(set(photo_set), count)
|
return random.sample(sorted(set(photo_set)), count)
|
||||||
|
|
||||||
def photo_count(self, public=True):
|
def photo_count(self, public=True):
|
||||||
"""Return a count of all the photos in this gallery."""
|
"""Return a count of all the photos in this gallery."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue