Common Views
Below you will find the API documentation for the views that are used throughout the Centurion ERP application.
View
Bases: OrganizationPermission
Abstract class common to all views
Functions
get_dynamic_permissions()
A function to build and return the permissions for the view
Danger
Don't directly use this class within your view as it's already assigned to the views that require it.
Attributes
template_name: str = 'form.html.j2'
Functions
get_form_kwargs()
Fetch kwargs for form
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
kwargs used in fetching form |
Add View
Bases: View
, CreateView
Attributes
template_name: str = 'form.html.j2'
Functions
get_form_kwargs()
Fetch kwargs for form
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
kwargs used in fetching form |
get_initial()
get_context_data(**kwargs)
Change View
Bases: View
, UpdateView
Attributes
template_name: str = 'form.html.j2'
Functions
get_form_kwargs()
Fetch kwargs for form
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
kwargs used in fetching form |
get_context_data(**kwargs)
Get template context
For items that have the ability to have external links, this function adds the external link details to the context.
Requirement
This function may be overridden with the caveat that this function is still called.
by the overriding function. i.e. super().get_context_data(skwargs)
Note
The adding of external_links
within this view is scheduled to be removed.
Returns:
Type | Description |
---|---|
dict
|
Context for the template to use inclusive of 'external_links' |
get_initial()
Delete View
Bases: OrganizationPermission
, DeleteView
Attributes
template_name: str = 'form.html.j2'
Display View
Bases: OrganizationPermission
, DetailView
A View used for displaying arbitrary data
Attributes
template_name: str = 'form.html.j2'
Functions
get_context_data(**kwargs)
Get template context
For items that have the ability to have external links, this function adds the external link details to the context.
Requirement
This function may be overridden with the caveat that this function is still called.
by the overriding function. i.e. super().get_context_data(skwargs)
Returns:
Type | Description |
---|---|
dict
|
Context for the template to use inclusive of 'external_links' |
Index View
Bases: View
, ListView
Attributes
model = None
Model the view is for
Leaving this value unset will prevent the item from showing up within the navigation menu
template_name: str = None
Functions
get_form_kwargs()
Fetch kwargs for form
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
kwargs used in fetching form |
__init__(**kwargs)
get_context_data(**kwargs)
About:
This page forms part of our Project Centurion ERP.
Page Metadata
Version: ToDo: place files short git commit hereDate Created: 2024-07-12
Date Edited: 2024-07-12
Contribution:
Would You like to contribute to our Centurion ERP project? You can assist in the following ways:
- Edit This Page If there is a mistake or a way you can improve it.
- Add a Page to the Manual if you would like to add an item to our manual
- Raise an Issue if there is something about this page you would like to improve, and git is unfamiliar to you.
ToDo: Add the page list of contributors