From c317310dcfdedae31463646b3039f7d10935acee Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 13 Oct 2021 17:06:45 +0200 Subject: [PATCH] Fix typo in extended related name --- photologue_custom/models.py | 2 +- photologue_custom/templates/photologue/gallery_detail.html | 2 +- photologue_custom/views.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/photologue_custom/models.py b/photologue_custom/models.py index 76be399..09e2765 100644 --- a/photologue_custom/models.py +++ b/photologue_custom/models.py @@ -40,7 +40,7 @@ class PhotoExtended(models.Model): # Extend Photologue Photo model. photo = models.OneToOneField( Photo, - related_name='extented', + related_name='extended', on_delete=models.CASCADE, ) diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html index f8f3ef4..f9f0819 100644 --- a/photologue_custom/templates/photologue/gallery_detail.html +++ b/photologue_custom/templates/photologue/gallery_detail.html @@ -65,7 +65,7 @@
{% for photo in photos %} - {{ photo.title }}{% if photo.date_taken %} - {{ photo.date_taken|date }} {{ photo.date_taken|time }}{% endif %} - {{ photo.extented.owner.get_full_name }} + {{ photo.title }}{% if photo.date_taken %} - {{ photo.date_taken|date }} {{ photo.date_taken|time }}{% endif %} - {{ photo.extended.owner.get_full_name }} {% endfor %}
diff --git a/photologue_custom/views.py b/photologue_custom/views.py index cb79800..509f6b8 100644 --- a/photologue_custom/views.py +++ b/photologue_custom/views.py @@ -56,12 +56,12 @@ class CustomGalleryDetailView(DetailView): # List owners context['owners'] = [] for photo in context['photos']: - if photo.extented.owner not in context['owners']: - context['owners'].append(photo.extented.owner) + if photo.extended.owner not in context['owners']: + context['owners'].append(photo.extended.owner) # Filter on owner if 'owner' in self.kwargs: - context['photos'] = context['photos'].filter(extented__owner__id=self.kwargs['owner']) + context['photos'] = context['photos'].filter(extended__owner__id=self.kwargs['owner']) return context