vkk.workhours.accounting.costs.general.urls

This submodule contains the routing configuration.

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