vkk.workhours.accounting.periods.urls

This submodule contains the routing configuration.

 1"""
 2This submodule contains the routing configuration.
 3"""
 4
 5from django.urls import path
 6from django.utils.translation import gettext_lazy as _
 7from django.forms import modelform_factory
 8from ..views import *
 9from .views import AccountingPeriodDetailView, AccountingPeriodDetailDepartmentView, AccountingPeriodDetailNoDepartmentView
10from vkk.workhours.models import Period
11from vkk.generic.forms import CustomDateInput, CustomDateTimeInput
12
13model = {'model': Period}
14fields = {'fields': ['start', 'end', 'dead_line', 'dead_line_final']}
15form_class = {'form_class': modelform_factory(**model, **fields,
16                                              widgets={
17                                                  'start': CustomDateInput,
18                                                  'end':  CustomDateInput,
19                                                  'dead_line': CustomDateTimeInput,
20                                                  'dead_line_final': CustomDateTimeInput
21                                              })
22              }
23action_options = {
24    'action_options': {
25        'details': _('Details'),
26        'update': _('Update'),
27        'delete': _('Delete'),
28    }
29}
30
31app_name = 'periods'
32urlpatterns = [
33    path(
34        _('<int:pk>/details/'),
35        AccountingPeriodDetailView.as_view(),
36        name='details'
37    ),
38    path(
39        _('<int:pk>/details/projects_open_by_department/<int:department_pk>'),
40        AccountingPeriodDetailDepartmentView.as_view(),
41        name='projects_open'
42    ),
43    path(
44        _('<int:pk>/details/projects_open_by_department/'),
45        AccountingPeriodDetailNoDepartmentView.as_view(),
46        name='projects_open_no_department'
47    ),
48    path(
49        _('create/'),
50        AccountingCreateView.as_view(**model, **form_class),
51        name='create'
52    ),
53    path(
54        _('create/success/'),
55        AccountingSuccessView.as_view(
56            template_name='vkk/generic/create_success.html',
57            **model
58        ),
59        name='create_success'
60    ),
61    path(
62        _('<int:pk>/update/'),
63        AccountingUpdateView.as_view(**model, **form_class),
64        name='update'
65    ),
66    path(
67        _('update/success/'),
68        AccountingSuccessView.as_view(
69            template_name='vkk/generic/update_success.html',
70            **model
71        ),
72        name='update_success'
73    ),
74    path(
75        _('<int:pk>/delete/'),
76        AccountingDeleteView.as_view(**model),
77        name='delete'
78    ),
79    path(
80        _('delete/success/'),
81        AccountingSuccessView.as_view(
82            template_name='vkk/generic/delete_success.html',
83            **model
84        ),
85        name='delete_success'
86    ),
87    path(
88        '',
89        AccountingListView.as_view(
90            **model,
91            **fields,
92            ordering=['-start'],
93            **action_options
94        ),
95        name='default'
96    ),
97]
model = {'model': <class 'vkk.workhours.models.Period'>}
fields = {'fields': ['start', 'end', 'dead_line', 'dead_line_final']}
form_class = {'form_class': <class 'django.forms.widgets.PeriodForm'>}
action_options = {'action_options': {'details': 'Details', 'update': 'Ändern', 'delete': 'Löschen'}}
app_name = 'periods'
urlpatterns = [<URLPattern '<int:pk>/details/' [name='details']>, <URLPattern '<int:pk>/details/projekte_offen_nach_einrichtung/<int:department_pk>' [name='projects_open']>, <URLPattern '<int:pk>/details/projects_open_by_department/' [name='projects_open_no_department']>, <URLPattern 'erstellen/' [name='create']>, <URLPattern 'erstellen/erfolg/' [name='create_success']>, <URLPattern '<int:pk>/aktualisieren/' [name='update']>, <URLPattern 'aktualisieren/erfolg/' [name='update_success']>, <URLPattern '<int:pk>/loeschen/' [name='delete']>, <URLPattern 'loeschen/erfolg/' [name='delete_success']>, <URLPattern '' [name='default']>]