From 5d92082e5d64abb26e80d219f2dc71352709215c Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 13 Oct 2024 21:06:38 +0930 Subject: [PATCH] docs: add new requirements for creating a model. ref: #248 #345 #346 --- docs/projects/centurion_erp/development/models.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/projects/centurion_erp/development/models.md b/docs/projects/centurion_erp/development/models.md index d3cb29e18..5337a4a1f 100644 --- a/docs/projects/centurion_erp/development/models.md +++ b/docs/projects/centurion_erp/development/models.md @@ -40,10 +40,18 @@ All models must meet the following requirements: - contains a `Meta` sub-class with following attributes: - - `verbose_name_plural` + - `ordering` _Order the results are returned in._ + + - `verbose_name` _Name of the Model._ + + - `verbose_name_plural` _Plural Name of the model_ - If creating a new model, function `access.functions.permissions.permission_queryset()` has been updated to display the models permission(s) +- Attribute `page_layout` is defined with the models UI page layout + +- Attribute `table_fields` is defined with the fields to display by default for viewing the model within a table. + ## Checklist @@ -53,6 +61,9 @@ This section details the additional items that may need to be done when adding a - If the model is a primary model, add it to the model link slash command in `app/core/lib/slash_commands/linked_model.py` function `command_linked_model` +!!! tip + It's a good idea to create the initial model class, then create and add the model tests for that class. This way you can run the tests to ensure that the requirements are met. Of Note, the tests may not cover ALL of the requirements section, due diligence will need to be exercised. + ## History