vkk.workhours.accounting.departments.urls

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