diff --git a/photologue/views.py b/photologue/views.py index 253da8f..3b474b9 100644 --- a/photologue/views.py +++ b/photologue/views.py @@ -149,6 +149,11 @@ class GalleryDetailView(LoginRequiredMixin, DetailView): # List owners context["owners"] = [] + + #owners_pk_distinct = context["photos"].order_by('owner__pk').values_list('owner__pk', flat=True).distinct() + #context["owners"] = User.objects.filter(pk__in=owners_pk_distinct) + + for photo in context["photos"]: if photo.owner not in context["owners"]: context["owners"].append(photo.owner)