X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/22e333d5e75ef180cf3b440f5c00e86f507476a8..7b250882b48932b7fc6a68575273c3fcbfcef97f:/sommitrealweird/photo/views.py?ds=inline diff --git a/sommitrealweird/photo/views.py b/sommitrealweird/photo/views.py index 02d80e6..77b4dd8 100644 --- a/sommitrealweird/photo/views.py +++ b/sommitrealweird/photo/views.py @@ -1,7 +1,16 @@ -import django.views.generic.list_detail +from django.views.generic import ListView from django.http import Http404 from models import Album, Photo +class AlbumListView(ListView): + model = Album + queryset = Album.objects.order_by('-name') + paginate_by = 20 + + def get_context_data(self, **kwargs): + context = super(AlbumListView, self).get_context_data(**kwargs) + return context + def album_view(request, slug): try: album = Album.objects.get(slug__exact=slug)