]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blobdiff - sommitrealweird/photo/urls.py
fix: quick and dirty update to django 4.2
[sommitrealweird.git] / sommitrealweird / photo / urls.py
index 8a17fd3b01f6cfa1c97372537b2f5cb9806f2709..c5de1db56b170bedfb9432ecc7f38d478009141d 100644 (file)
@@ -1,8 +1,9 @@
-from django.conf.urls.defaults import *
-from models import Album
+from django.urls import re_path
+from photo.models import Album
+from photo.views import AlbumListView, PhotoListView, PhotoView
 
-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 = [
+    re_path(r'^$', AlbumListView.as_view()),
+    re_path(r'^(?P<slug>[^/]*)/$', PhotoListView.as_view()),
+    re_path(r'^(?P<slug>[^/]*)/(?P<id>[0-9]+)/$', PhotoView.as_view()),
+]