diff options
author | luxagraf <sng@luxagraf.net> | 2018-02-06 10:36:26 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-02-06 10:36:26 -0600 |
commit | 58473dd4e0758894f15f834bddedd0caf11cfa59 (patch) | |
tree | 6f4d4fb9e120813bcbaaf03044fdb84eb7764c41 /app/books | |
parent | adcd4671a261aa72d459b691aabb6f2eef2a0cb7 (diff) |
converted to new path url structure and updated pagination to handle it.
Diffstat (limited to 'app/books')
-rw-r--r-- | app/books/urls.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/app/books/urls.py b/app/books/urls.py index 89c125e..4855149 100644 --- a/app/books/urls.py +++ b/app/books/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url +from django.urls import path, re_path from django.views.generic.base import RedirectView from . import views @@ -6,19 +6,20 @@ from . import views app_name = "books" urlpatterns = [ - url( - r'(?P<page>\d+)/$', + re_path( + r'^(?P<page>\d+)/$', views.BookListView.as_view(), - name='list', + name="list" ), - url( - r'(?P<slug>[-\w]+)$', + path( + r'', + views.BookListView.as_view(), + {'page':1}, + name="list" + ), + path( + r'<str:slug>/', views.BookDetailView.as_view(), name='detail', ), - url( - r'^$', - RedirectView.as_view(url="/books/1/", permanent=False), - name="live_redirect" - ), ] |