31 lines
1.3 KiB
Python
31 lines
1.3 KiB
Python
from django.conf.urls import include
|
|
from django.contrib.auth.decorators import login_required
|
|
from django.urls import path
|
|
from rest_framework import routers
|
|
|
|
from billard import views
|
|
|
|
router = routers.DefaultRouter()
|
|
router.register(r'locationdata', views.LocationDataViewSet)
|
|
router.register(r'last_seen', views.ClientUpdateLastSeenViewSet)
|
|
|
|
app_name = 'billard'
|
|
urlpatterns = [
|
|
# ex. /billard/
|
|
path('', login_required(views.LocationIndexView.as_view()), name='location_index'),
|
|
# ex. /billard/1/
|
|
path('<int:pk>/', login_required(views.LocationDetailView.as_view()), name='location_detail'),
|
|
# ex. /billard/1/accounting/
|
|
path('<int:pk>/accounting/', views.AccountingView.as_view(), name='accounting_detail'),
|
|
# ex. /billard/1/accounting/confirm
|
|
path('<int:pk>/accounting/confirm/', views.accounting_confirm, name='accounting_detail_confirm'),
|
|
# ex. /billard/1/account_modal/
|
|
path('<int:loc_pk>/account_modal/', views.account_modal_view, name='account_modal'),
|
|
# ex. /billard/1/account_modal/confirm/
|
|
path('<int:loc_pk>/account_modal/<pks>/confirm/', views.account_modal_confirm_view, name='account_modal_confirm'),
|
|
# ex. /billard/api/v1/ (rest api)
|
|
path('api/v1/', include(router.urls)),
|
|
# ex. /billard/myaccount/
|
|
path('my_account', views.UserUpdateView.as_view(), name='my_account'),
|
|
]
|