]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blobdiff - sommitrealweird/photo/urls.py
Initial port to django-1.7
[sommitrealweird.git] / sommitrealweird / photo / urls.py
index 8a17fd3b01f6cfa1c97372537b2f5cb9806f2709..dbea64f99eca4e3d7560208fba04d33b857e1fbc 100644 (file)
@@ -1,8 +1,9 @@
-from django.conf.urls.defaults import *
+from django.conf.urls import url
 from models import Album
+from views import AlbumListView
 
-urlpatterns = patterns('',
-    (r'^$', 'django.views.generic.list_detail.object_list', { "paginate_by": 20, "queryset": Album.objects.all(), "template_name": "photo/album_index.html"}),
-    (r'^(?P<slug>[^/]*)/$', 'photo.views.album_view'),
-    (r'^(?P<slug>[^/]*)/(?P<id>[0-9]+)/$', 'photo.views.photo_view'),
-)
+urlpatterns = [
+    url(r'^$', AlbumListView.as_view()),
+    url(r'^(?P<slug>[^/]*)/$', 'photo.views.album_view'),
+    url(r'^(?P<slug>[^/]*)/(?P<id>[0-9]+)/$', 'photo.views.photo_view'),
+]