carom-server/billard/urls.py

31 lines
1.3 KiB
Python
Raw Permalink Normal View History

2018-02-11 10:50:48 +01:00
from django.conf.urls import include
2017-04-27 08:04:44 +02:00
from django.contrib.auth.decorators import login_required
2018-02-11 10:50:48 +01:00
from django.urls import path
2017-01-03 19:55:01 +01:00
from rest_framework import routers
2018-02-11 10:50:48 +01:00
2017-01-03 19:55:01 +01:00
from billard import views
router = routers.DefaultRouter()
2017-08-03 19:52:43 +02:00
router.register(r'locationdata', views.LocationDataViewSet)
2018-02-11 11:27:27 +01:00
router.register(r'last_seen', views.ClientUpdateLastSeenViewSet)
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/
2018-02-11 10:50:48 +01:00
path('', login_required(views.LocationIndexView.as_view()), name='location_index'),
2017-04-27 08:04:44 +02:00
# ex. /billard/1/
2018-02-11 10:50:48 +01:00
path('<int:pk>/', login_required(views.LocationDetailView.as_view()), name='location_detail'),
2017-04-27 08:04:44 +02:00
# ex. /billard/1/accounting/
2018-02-11 10:50:48 +01:00
path('<int:pk>/accounting/', views.AccountingView.as_view(), name='accounting_detail'),
2017-04-27 13:23:18 +02:00
# ex. /billard/1/accounting/confirm
2018-02-11 10:50:48 +01:00
path('<int:pk>/accounting/confirm/', views.accounting_confirm, name='accounting_detail_confirm'),
2017-04-27 13:56:18 +02:00
# ex. /billard/1/account_modal/
2018-02-11 10:50:48 +01:00
path('<int:loc_pk>/account_modal/', views.account_modal_view, name='account_modal'),
2017-04-27 13:56:18 +02:00
# ex. /billard/1/account_modal/confirm/
2018-02-11 10:50:48 +01:00
path('<int:loc_pk>/account_modal/<pks>/confirm/', views.account_modal_confirm_view, name='account_modal_confirm'),
2017-04-27 14:03:57 +02:00
# ex. /billard/api/v1/ (rest api)
2018-02-11 10:50:48 +01:00
path('api/v1/', include(router.urls)),
2018-02-13 08:38:17 +01:00
# ex. /billard/myaccount/
path('my_account', views.UserUpdateView.as_view(), name='my_account'),
2017-01-06 20:24:36 +01:00
]