-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)