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/unused_apps/birds/urls.py | |
parent | adcd4671a261aa72d459b691aabb6f2eef2a0cb7 (diff) |
converted to new path url structure and updated pagination to handle it.
Diffstat (limited to 'app/unused_apps/birds/urls.py')
-rw-r--r-- | app/unused_apps/birds/urls.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app/unused_apps/birds/urls.py b/app/unused_apps/birds/urls.py new file mode 100644 index 0000000..8781433 --- /dev/null +++ b/app/unused_apps/birds/urls.py @@ -0,0 +1,34 @@ +from django.conf.urls import url +from django.views.generic.base import RedirectView +from . import views + +app_name = "birds" + +urlpatterns = [ + url( + r'(?P<user>[\w]+)/(?P<page>\d+)/', + views.BirdListUserView.as_view(), + name='list_by_person' + ), + url( + r'(?P<page>\d+)/$', + views.BirdListView.as_view(), + name="list" + ), + url( + r'^(?P<slug>[-_\w]+)$', + views.BirdDetailView.as_view(), + name='detail' + ), + # redirect /slug/ to /slug/1/ for live server + url( + r'(?P<user>[-\w]+)/$', + RedirectView.as_view(url="/birds/%(user)s/1/", permanent=False), + name="list_person_redirect" + ), + url( + r'', + RedirectView.as_view(url="/birds/1/", permanent=False), + name="list_redirect" + ), +] |