]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blobdiff - sommitrealweird/photo/views.py
Remove debug statements
[sommitrealweird.git] / sommitrealweird / photo / views.py
index 02d80e67be0435a7dd04554ac6f9cc5b5b7be9f6..77b4dd88c9e14134de991c1cc28c74de2557a623 100644 (file)
@@ -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)