projects
/
sommitrealweird.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c8cb8b
)
Fix photo ordering
author
Brett Parker
<iDunno@sommitrealweird.co.uk>
Mon, 8 Jun 2020 13:18:43 +0000
(14:18 +0100)
committer
Brett Parker
<iDunno@sommitrealweird.co.uk>
Mon, 8 Jun 2020 13:19:05 +0000
(14:19 +0100)
sommitrealweird/photo/views.py
patch
|
blob
|
history
diff --git
a/sommitrealweird/photo/views.py
b/sommitrealweird/photo/views.py
index fea7dd3750785654e2728d88d2a15771d1dadf87..bddd15dac75772187c90841e3964e35f463294d0 100644
(file)
--- a/
sommitrealweird/photo/views.py
+++ b/
sommitrealweird/photo/views.py
@@
-10,12
+10,14
@@
class AlbumListView(ListView):
class PhotoListView(ListView):
model = Photo
paginate_by = 20
- order_by = 'order, image'
+
+ def order_by(self):
+ return self.ordering
def get_queryset(self):
try:
album = Album.objects.get(slug__exact=self.kwargs['slug'])
- return Photo.objects.filter(album=album)
+ return Photo.objects.filter(album=album)
.order_by('order', 'image')
except:
raise Http404