forked from coders4help/volunteer_planner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathurls.py
28 lines (20 loc) · 1003 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# coding: utf-8
from django.conf.urls import url
from .views import HelpDesk, PlannerView, ShiftDetailView
urlpatterns = [
url(r'^$', HelpDesk.as_view(), name="helpdesk"),
# (A): needed for direct access of of a shift details site
# via shifthelper.shift.get_absolute_url() (+"/direct/) (C) is needed for other things
# (example of get_absolute_url() of a shift is: /helpdesk/facility190/shifts/2016/1/15/81 )
url(r'^(?P<facility_slug>[^/]+)/shifts/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<shift_id>\d+)/direct/?$',
PlannerView.as_view(),
name="planner_by_facility"),
# (B):
url(r'^(?P<facility_slug>[^/]+)/shifts/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$',
PlannerView.as_view(),
name="planner_by_facility"),
# (C):
url(r'^(?P<facility_slug>[^/]+)/shifts/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<shift_id>\d+)/?$',
ShiftDetailView.as_view(),
name="shift_details"),
]