Commits

Josiah Klassen committed 5e6343a

Change function-based generic view to class-based.

As per their deprecation policy, Django 1.5 removed function-based
generic views.

  • Participants
  • Parent commits eb4040c

Comments (0)

Files changed (1)

sphinxdoc/urls.py

 
 """
 from django.conf.urls.defaults import patterns, url
-from django.views.generic import list_detail
+from django.views.generic.list import ListView
 
 from sphinxdoc import models
 from sphinxdoc.views import ProjectSearchView
 
 
-project_info = {
-    'queryset': models.Project.objects.all().order_by('name'),
-    'template_object_name': 'project',
-}
-
 urlpatterns = patterns('sphinxdoc.views',
     url(
         r'^$',
-        list_detail.object_list,
-        project_info,
+        ListView.as_view(queryset=models.Project.objects.all().order_by('name'))
     ),
     url(
         r'^(?P<slug>[\w-]+)/search/$',