feat: Administratively set global items org/is_global field now read-only

!42 fixes #126
This commit is contained in:
2024-07-16 13:12:37 +09:30
parent 7c62309a31
commit 7b26fac73d
13 changed files with 99 additions and 16 deletions

View File

@ -0,0 +1,19 @@
---
title: Common forms
description: Centurion ERP Common Forms API Documentation
date: 2024-07-12
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
Below you will find the API documentation for the forms that are used throughout the Centurion ERP application.
## Admin Global Model Form
This class in intended to be inherited by any form that has an administrative setting to set the model as global and to be placed within a dedicated "Global organization"
::: app.settings.forms.admin_settings_global.AdminGlobalModels
options:
inherited_members: false
heading_level: 3

View File

@ -15,7 +15,7 @@ All forms must meet the following requirements:
- is defined as a class
- inherits from [`core.forms.common.CommonModelForm`](./api/form.md)
- inherits from [`core.forms.common.CommonModelForm`](./api/model_form.md)
- contains a `Meta` sub-class with following parameters:
@ -23,6 +23,15 @@ All forms must meet the following requirements:
- `model`
- Any additional filtering is done as part of an `__init__` method that also calls the super-class [`__init__`](./api/form.md) first
- Any additional filtering is done as part of an `__init__` method that also calls the super-class [`__init__`](./api/model_form.md) first
- Any filtering of a fields `queryset` is to filter the existing `queryset` not redefine it. i.e. `field[<field name>].queryset = field[<field name>].queryset.filter()`
## Abstract Classes
The following abstract classes exist for a forms inheritance:
- [AdminGlobalModels](./api/admin_model_form.md#model-form)
- [CommonModelForm](./api/model_form.md#model-form)

View File

@ -15,7 +15,7 @@ Centurion ERP is a Django Application. We have added a lot of little tid bits th
- [Application API Documentation](./api/index.md)
- [Forms](./api/form.md)
- [Forms](./forms.md)
- [Models](./models.md)