Show private photos count for admins

This commit is contained in:
Alexandre Iooss 2022-03-01 21:56:04 +01:00
parent aa45386976
commit 7d6d965191
2 changed files with 6 additions and 0 deletions

View file

@ -187,7 +187,12 @@ class Gallery(models.Model):
else:
return self.photos.count()
def photo_private_count(self):
"""Return a count of private photos in this gallery."""
return self.photos.filter(is_public=False).count()
photo_count.short_description = _('count')
photo_private_count.short_description = _('private count')
class ImageModel(models.Model):