feat(core): add var template_name
to common view template for all views that require it
!35
This commit is contained in:
@ -11,6 +11,8 @@ class View(OrganizationPermission):
|
||||
Don't directly use this class within your view as it's already assigned to the views that require it.
|
||||
"""
|
||||
|
||||
template_name:str = 'form.html.j2'
|
||||
|
||||
|
||||
def get_form_kwargs(self) -> dict:
|
||||
""" Fetch kwargs for form
|
||||
@ -31,25 +33,26 @@ class View(OrganizationPermission):
|
||||
|
||||
class AddView(View, generic.CreateView):
|
||||
|
||||
pass
|
||||
template_name:str = 'form.html.j2'
|
||||
|
||||
|
||||
|
||||
class ChangeView(View, generic.UpdateView):
|
||||
|
||||
pass
|
||||
template_name:str = 'form.html.j2'
|
||||
|
||||
|
||||
|
||||
class DeleteView(OrganizationPermission, generic.DeleteView):
|
||||
|
||||
pass
|
||||
template_name:str = 'form.html.j2'
|
||||
|
||||
|
||||
|
||||
class DisplayView(OrganizationPermission, generic.DetailView):
|
||||
""" A View used for displaying arbitrary data """
|
||||
|
||||
pass
|
||||
template_name:str = 'form.html.j2'
|
||||
|
||||
|
||||
|
||||
@ -61,6 +64,8 @@ class IndexView(View, generic.ListView):
|
||||
Leaving this value unset will prevent the item from showing up within the navigation menu
|
||||
"""
|
||||
|
||||
template_name:str = None
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
if not self.model:
|
||||
|
Reference in New Issue
Block a user