Centurion Tenancy Abstract Model
This abstract model establishes the tenancy features for ALL models within Centurion ERP
Bases: Model
Tenancy Model Abstract class.
This class is for inclusion within every model within Centurion ERP. Provides the required fields, functions and methods for multi tennant objects. Unless otherwise stated, no object within this class may be overridden.
Raises:
Type | Description |
---|---|
ValidationError
|
User failed to supply organization |
Attributes
context
Model Context
Generally model usage will be from an API serializer, Admin Site or a management command. These sources are to pass through and set this context. The keys are:
Warning
Failing to specify the user will prevent the tenancy manager from being multi-tenant. As such, the results retured will not be restricted to the users tenancy
Returns:
Name | Type | Description |
---|---|---|
logger |
Logger
|
Instance of a logger for logging. |
user |
User
|
The user that is logged into the system |
Context for actions within the model.
objects
~~Multi-Tenant Manager~~
Note: ~~This manager relies upon the model class having context['user']
set. without a user the manager can not perform multi-tenant queries.~~
organization
organization = ForeignKey(Tenant, blank=False, help_text='Tenant this belongs to', null=False, on_delete=CASCADE, related_name='+', validators=[validatate_organization_exists], verbose_name='Tenant')
Classes
Functions
get_tenant
Return the models Tenancy
This model can be safely over-ridden as long as it returns the models tenancy
About:
This page forms part of our Project Centurion ERP.
Page Metadata
Version: ToDo: place files short git commit hereDate Created: 2025-05-25
Date Edited: 2025-05-24
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