You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ It is a required module of [openimis-be_py](https://github.com/openimis/openimis
16
16
## ORM mapping:
17
17
* UUIDModel: abstract model for new entities (and later on migrated entities), enforcing the use of UUID is identifier
18
18
* VersionedModel: abstract model implementing the legacy 'in table archiving' mechanism
19
-
* HistoryModel: abstract model implementing the django-simple-history archiving mechanism with standard mutaitons
19
+
* HistoryModel: abstract model implementing the django-simple-history archiving mechanism with standard mutations
20
20
* HistoryBusinessModel: abstract model implementing the django-simple-history archiving mechanism with ValidFrom and ValidTo date and with standard and replace mutations
21
21
* core_ModuleConfiguration > ModuleConfiguration: a generic entity each module should use to let (admin)users provide the expected configuration (via a central management console).
22
22
* core_FieldControl > FieldControl: allow to hide or mark readonly fields in UI (tables, forms,...)
@@ -67,12 +67,12 @@ from core.fields import DateField, DateTimeField
67
67
```
68
68
69
69
### UserManager
70
-
openIMIS backend is configured for SSO, receiving the user (login) in the REMOTE_USER http header. Since django security is defined uppon User (core_User table), the UserManager auto-provision the received login (REMOTE_USER) as User, binding it (i_user) to the corresponding InteractiveUser record.
70
+
openIMIS backend is configured for SSO, receiving the user (login) in the REMOTE_USER http header. Since django security is defined upon User (core_User table), the UserManager auto-provision the received login (REMOTE_USER) as User, binding it (i_user) to the corresponding InteractiveUser record.
71
71
The auto-provisioning assigns a default Group (name can be parameterized) from which django permissions are calculated (with UserRole - Role - RoleRight contributed from InteractiveUser).
72
72
Note: if not existing, the default group is created at startup.
73
73
74
74
### Language Support for Role Labels
75
-
If the user has a language different from the system default and a translation is available in alt_language, the role name is returned in that language. Otherwise, it falls back to the default name. This ensures localized role labels are shown based on the user's language preferences.
75
+
Role names are displayed in the user's selected language using Django's translation system with .po and .mo files. If a translation is available for the user's language (e.g., fr), the translated role name is shown. Otherwise, it falls back to the default role name. This ensures localized role labels are displayed based on the user's language preferences, managed through translation files rather than a database column.
76
76
77
77
### Mutations & Signals
78
78
The OpenIMISMutation class of this module provides the template code for
@@ -114,7 +114,7 @@ If the callback returns an array of error message:
114
114
```
115
115
If the callback returns None (or an empty array), the mutation is marked as successful.
116
116
117
-
__Important Note__: by default the callback is executed __in transaction__ and, as a consequence, will (in case of exception/errors) cancel the complete mutation. If this is not the desired behaviour, the callback must explicitely detach to separate transaction (process).
117
+
__Important Note__: by default the callback is executed __in transaction__ and, as a consequence, will (in case of exception/errors) cancel the complete mutation. If this is not the desired behaviour, the callback must explicitly detach to separate transaction (process).
118
118
119
119
#### Extending mutations with signals
120
120
Signal callbacks could use mutationExtensions JSON field to receive additional data from mutation payload. This
@@ -139,15 +139,15 @@ function to connect new signals. Receivers can be registered also in other place
139
139
140
140
#### Modules Scheduled Tasks
141
141
To add a scheduled task directly from within a module, add the file `scheduled_tasks.py`
142
-
in the module package. From there, the function `schedule_tasks` accepting `BackgroundScheudler`
142
+
in the module package. From there, the function `schedule_tasks` accepting `BackgroundScheduler`
143
143
as argument must be accessible.
144
144
145
145
**Example content of scheduled_tasks.py:**
146
146
```python
147
147
defmodule_task():
148
148
...
149
149
150
-
defschedule_tasks(scheduler: BackgroundScheduler): # Has to accept BackgroundScheudler as input
150
+
defschedule_tasks(scheduler: BackgroundScheduler): # Has to accept BackgroundScheduler as input
* schema.SmallInt: Integer, with values ranging from -32768 to +32767
163
163
* schema.TinyInt: Integer (8 bit), with values ranging from 0 to 255
164
-
* utils.filter_validity: many openIMIS entities have a validity_from/validity_to, this filters provides a helper implementing the vality logic based on date (today if None)
164
+
* utils.filter_validity: many openIMIS entities have a validity_from/validity_to, this filters provides a helper implementing the validity logic based on date (today if None)
165
165
Sample usage:
166
166
```
167
167
Insuree.objects.get(
@@ -235,14 +235,14 @@ TechnicalUserForm (ability to add technical users from the console)
235
235
which allows filtering by json field attributes in the SQL Server database. Filtering by simple data types and nested
- get_linked_class(List[classname]) - that function will return the possible instance that can have a link to the calculation
348
348
- convert(instance, convert_to, **argv) - Convert on or several object toward another type, especially to invoice or bill . It will check the from-to, and the rights then will call the Function Name with agrv as parameters
349
349
* generic methods defined on abstract class level
350
-
- get_rule_name(classname) - return an object which is representation of calculaton rule
350
+
- get_rule_name(classname) - return an object which is representation of calculation rule
351
351
- get_rule_details(classname) - return the data about class and parameters
352
352
- get_parameters(class_name, instance) - Function to obtain the required parameter and its properties for an instance of certain model.
353
353
This function is registered to the module signal via the ready function if the rule is active
0 commit comments