1from django.urls import path, include
2from django.utils.translation import gettext_lazy as _
3from vkk.models import DepartmentDate
4from vkk.workhours.accounting.views import (
5 AccountingCreateView, AccountingUpdateView,
6 AccountingDeleteView, AccountingListView,
7 AccountingSuccessView
8)
9from ..forms import DepartmentCostForm
10
11model = {'model': DepartmentDate}
12
13app_name = 'departments'
14urlpatterns = [
15 path(
16 _('create/'),
17 AccountingCreateView.as_view(
18 form_class=DepartmentCostForm,
19 **model
20 ),
21 name='create'
22 ),
23 path(
24 _('create/success/'),
25 AccountingSuccessView.as_view(
26 template_name='vkk/generic/create_success.html',
27 **model
28 ),
29 name='create_success'
30 ),
31 path(
32 _('<int:pk>/update/'),
33 AccountingUpdateView.as_view(
34 form_class=DepartmentCostForm,
35 **model
36 ),
37 name='update'
38 ),
39 path(
40 _('update/success/'),
41 AccountingSuccessView.as_view(
42 template_name='vkk/generic/update_success.html',
43 **model
44 ),
45 name='update_success'
46 ),
47 path(
48 _('<int:pk>/delete/'),
49 AccountingDeleteView.as_view(**model),
50 name='delete'
51 ),
52 path(
53 _('delete/success/'),
54 AccountingSuccessView.as_view(
55 template_name='vkk/generic/delete_success.html',
56 **model
57 ),
58 name='delete_success'
59 ),
60 path(
61 '',
62 AccountingListView.as_view(
63 **model,
64 fields=['date'],
65 ordering=['date'],
66 ),
67 name='default'
68 ),
69]