2017-01-03 19:55:01 +01:00
|
|
|
from django.conf.urls import url, include
|
2017-04-27 08:04:44 +02:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2017-01-03 19:55:01 +01:00
|
|
|
from rest_framework import routers
|
|
|
|
from billard import views
|
|
|
|
|
|
|
|
router = routers.DefaultRouter()
|
2017-08-03 19:52:43 +02:00
|
|
|
router.register(r'locationdata', views.LocationDataViewSet)
|
2017-01-03 19:55:01 +01:00
|
|
|
|
2017-04-27 08:04:44 +02:00
|
|
|
app_name = 'billard'
|
2017-01-03 19:55:01 +01:00
|
|
|
urlpatterns = [
|
2017-04-27 08:04:44 +02:00
|
|
|
# ex. /billard/
|
2017-04-27 10:35:10 +02:00
|
|
|
url(r'^$', login_required(views.LocationIndexView.as_view()), name='location_index'),
|
2017-04-27 08:04:44 +02:00
|
|
|
# ex. /billard/1/
|
|
|
|
url(r'^(?P<pk>[0-9]+)/$', login_required(views.LocationDetailView.as_view()), name='location_detail'),
|
|
|
|
# ex. /billard/1/accounting/
|
2017-04-27 12:24:38 +02:00
|
|
|
url(r'^(?P<pk>[0-9]+)/accounting/$', views.AccountingView.as_view(), name='accounting_detail'),
|
2017-04-27 13:23:18 +02:00
|
|
|
# ex. /billard/1/accounting/confirm
|
|
|
|
url(r'^(?P<pk>[0-9]+)/accounting/confirm/$', views.accounting_confirm, name='accounting_detail_confirm'),
|
2017-04-27 13:56:18 +02:00
|
|
|
# ex. /billard/1/account_modal/
|
2017-04-27 14:22:23 +02:00
|
|
|
url(r'^(?P<loc_pk>[0-9]+)/account_modal/$', views.account_modal_view, name='account_modal'),
|
2017-04-27 13:56:18 +02:00
|
|
|
# ex. /billard/1/account_modal/confirm/
|
2017-08-17 20:16:25 +02:00
|
|
|
url(r'^(?P<loc_pk>[0-9]+)/account_modal/(?P<pks>[0-9]+(,[0-9]+)*)/confirm/$', views.account_modal_confirm_view,
|
2017-04-27 14:22:23 +02:00
|
|
|
name='account_modal_confirm'),
|
2017-04-27 14:03:57 +02:00
|
|
|
# ex. /billard/api/v1/ (rest api)
|
2017-04-27 13:23:18 +02:00
|
|
|
url(r'api/v1/', include(router.urls)),
|
2017-04-27 14:03:57 +02:00
|
|
|
# ex. /billard/process_location_data/
|
|
|
|
url(r'^process_location_data/$', views.process_location_data, name='process_location_data'),
|
2017-01-06 20:24:36 +01:00
|
|
|
]
|