29 lines
1.3 KiB
Python
29 lines
1.3 KiB
Python
from django.conf.urls import url, include
|
|
from django.contrib.auth.decorators import login_required
|
|
from rest_framework import routers
|
|
from billard import views
|
|
|
|
router = routers.DefaultRouter()
|
|
router.register(r'location_data', views.LocationDataViewSet)
|
|
|
|
app_name = 'billard'
|
|
urlpatterns = [
|
|
# ex. /billard/
|
|
url(r'^$', login_required(views.LocationIndexView.as_view()), name='location_index'),
|
|
# ex. /billard/1/
|
|
url(r'^(?P<pk>[0-9]+)/$', login_required(views.LocationDetailView.as_view()), name='location_detail'),
|
|
# ex. /billard/1/accounting/
|
|
url(r'^(?P<pk>[0-9]+)/accounting/$', views.AccountingView.as_view(), name='accounting_detail'),
|
|
# ex. /billard/1/accounting/confirm
|
|
url(r'^(?P<pk>[0-9]+)/accounting/confirm/$', views.accounting_confirm, name='accounting_detail_confirm'),
|
|
# ex. /billard/1/account_modal/
|
|
url(r'^(?P<loc_pk>[0-9]+)/account_modal/$', views.account_modal_view, name='account_modal'),
|
|
# ex. /billard/1/account_modal/confirm/
|
|
url(r'^(?P<loc_pk>[0-9]+)/account_modal/(?P<pk>[0-9]+)/confirm/$', views.account_modal_confirm_view,
|
|
name='account_modal_confirm'),
|
|
# ex. /billard/api/v1/ (rest api)
|
|
url(r'api/v1/', include(router.urls)),
|
|
# ex. /billard/process_location_data/
|
|
url(r'^process_location_data/$', views.process_location_data, name='process_location_data'),
|
|
]
|