Comment bdd optimisations
This commit is contained in:
parent
6dd56b94ef
commit
a4cdcd4039
1 changed files with 5 additions and 0 deletions
|
|
@ -149,6 +149,11 @@ class GalleryDetailView(LoginRequiredMixin, DetailView):
|
||||||
|
|
||||||
# List owners
|
# List owners
|
||||||
context["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"]:
|
for photo in context["photos"]:
|
||||||
if photo.owner not in context["owners"]:
|
if photo.owner not in context["owners"]:
|
||||||
context["owners"].append(photo.owner)
|
context["owners"].append(photo.owner)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue