X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/0e9a61759bfbc6c916dbbfce412c7fe72b261a2b..5d2c22628bbba4eb7ea12a1f5e11bdcc6c866e03:/sommitrealweird/photo/views.py 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)