Skip to content

Views


Views are used with Centurion ERP to Fetch the data for rendering as html. We have templated our views to aid in quick development. We have done this by adding to our views the required pieces of logic so as to ensure the right information is available. The available API can be found within the API Views docs.

The views that we use are:

  • Index

    Models index page

  • Add

    For adding data to model tables

  • Change

    Changing data within a model

  • Delete

    Delete a model

  • Display

    Display a model

Common test cases are available for views. These test cases can be found within the API docs under model view test cases.

Requirements

All views are to meet the following requirements:

  • is defined as a class

  • View class inherits from one of the above listed views

  • View class has the following attributes definedL

    • form_class for the display of forms.

    • model for which data model to use.

  • Add and change views to use a form class

Tests

The following unit test cases exist for views:

Tip

The AllViews test class is an aggregation of all views. This class is the recommended test class to include if the model uses all available views.

Docs to clean up

Note

The below documentation is still to be developed. As such what is written below may be incorrect.

Templates

The base template includes blocks that are designed to assist in rendering your content. The following blocks are available:

  • title - The page and title

  • content_header_icon - Header icon that is middle aligned with the page title, floating right.

  • body - The html content of the page

template.html.j2
{% extends 'base.html.j2' %}

{% block title %}{% endblock %}
{% block content_header_icon %}<span title="View History" id="content_header_icon">H</span>{% endblock %}

{% block body %}

your content here

{% endblock %}

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-15

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