Fix typo in extended related name
This commit is contained in:
parent
cc3ba4a492
commit
c317310dcf
3 changed files with 5 additions and 5 deletions
|
|
@ -40,7 +40,7 @@ class PhotoExtended(models.Model):
|
||||||
# Extend Photologue Photo model.
|
# Extend Photologue Photo model.
|
||||||
photo = models.OneToOneField(
|
photo = models.OneToOneField(
|
||||||
Photo,
|
Photo,
|
||||||
related_name='extented',
|
related_name='extended',
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
<div id="lightgallery">
|
<div id="lightgallery">
|
||||||
{% for photo in photos %}
|
{% for photo in photos %}
|
||||||
<a href="{{ photo.get_absolute_url }}" data-src="{{ photo.get_display_url }}" data-download-url="{{ photo.image.url }}">
|
<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>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -56,12 +56,12 @@ class CustomGalleryDetailView(DetailView):
|
||||||
# List owners
|
# List owners
|
||||||
context['owners'] = []
|
context['owners'] = []
|
||||||
for photo in context['photos']:
|
for photo in context['photos']:
|
||||||
if photo.extented.owner not in context['owners']:
|
if photo.extended.owner not in context['owners']:
|
||||||
context['owners'].append(photo.extented.owner)
|
context['owners'].append(photo.extended.owner)
|
||||||
|
|
||||||
# Filter on owner
|
# Filter on owner
|
||||||
if 'owner' in self.kwargs:
|
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
|
return context
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue