Fix typo in extended related name

This commit is contained in:
Alexandre Iooss 2021-10-13 17:06:45 +02:00
parent cc3ba4a492
commit c317310dcf
3 changed files with 5 additions and 5 deletions

View file

@ -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,
)

View file

@ -65,7 +65,7 @@
<div id="lightgallery">
{% for photo in photos %}
<a href="{{ photo.get_absolute_url }}" data-src="{{ photo.get_display_url }}" data-download-url="{{ photo.image.url }}">
<img src="{{ photo.get_thumbnail_url }}" class="img-thumbnail" alt="{{ photo.title }}{% if photo.date_taken %} - {{ photo.date_taken|date }} {{ photo.date_taken|time }}{% endif %} - {{ photo.extented.owner.get_full_name }}">
<img src="{{ photo.get_thumbnail_url }}" class="img-thumbnail" alt="{{ photo.title }}{% if photo.date_taken %} - {{ photo.date_taken|date }} {{ photo.date_taken|time }}{% endif %} - {{ photo.extended.owner.get_full_name }}">
</a>
{% endfor %}
</div>

View file

@ -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