Skip to content

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

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()

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'

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)

About:

This page forms part of our Project Centurion ERP.

Page Metadata
Version: ToDo: place files short git commit here
Date 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:

 

ToDo: Add the page list of contributors