GeneralManager 0.5.1__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {generalmanager-0.5.1 → generalmanager-0.6.0}/GeneralManager.egg-info/PKG-INFO +43 -43
  2. {generalmanager-0.5.1 → generalmanager-0.6.0}/GeneralManager.egg-info/SOURCES.txt +10 -0
  3. {generalmanager-0.5.1 → generalmanager-0.6.0}/PKG-INFO +43 -43
  4. generalmanager-0.6.0/README.md +142 -0
  5. {generalmanager-0.5.1 → generalmanager-0.6.0}/pyproject.toml +12 -20
  6. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/api/graphql.py +2 -1
  7. generalmanager-0.6.0/src/general_manager/bucket/baseBucket.py +240 -0
  8. generalmanager-0.5.1/src/general_manager/interface/calculationInterface.py → generalmanager-0.6.0/src/general_manager/bucket/calculationBucket.py +192 -121
  9. generalmanager-0.6.0/src/general_manager/bucket/databaseBucket.py +235 -0
  10. generalmanager-0.6.0/src/general_manager/bucket/groupBucket.py +296 -0
  11. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/cache/modelDependencyCollector.py +5 -8
  12. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/interface/baseInterface.py +28 -105
  13. generalmanager-0.6.0/src/general_manager/interface/calculationInterface.py +119 -0
  14. generalmanager-0.5.1/src/general_manager/interface/databaseInterface.py → generalmanager-0.6.0/src/general_manager/interface/databaseBasedInterface.py +141 -348
  15. generalmanager-0.6.0/src/general_manager/interface/databaseInterface.py +106 -0
  16. generalmanager-0.6.0/src/general_manager/interface/readOnlyInterface.py +107 -0
  17. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/manager/generalManager.py +11 -10
  18. generalmanager-0.6.0/src/general_manager/manager/groupManager.py +125 -0
  19. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/manager/meta.py +19 -5
  20. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/permission/basePermission.py +4 -6
  21. generalmanager-0.6.0/src/general_manager/permission/fileBasedPermission.py +0 -0
  22. generalmanager-0.6.0/tests/test_baseBucket.py +325 -0
  23. generalmanager-0.6.0/tests/test_baseInterface.py +273 -0
  24. generalmanager-0.6.0/tests/test_dabaseBasedInterface.py +274 -0
  25. generalmanager-0.6.0/tests/test_databaseBucket.py +333 -0
  26. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_generalManager.py +16 -16
  27. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_generalManagerMeta.py +4 -3
  28. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_groupManager.py +5 -2
  29. generalmanager-0.5.1/README.md +0 -142
  30. generalmanager-0.5.1/src/general_manager/interface/__init__.py +0 -3
  31. generalmanager-0.5.1/src/general_manager/manager/groupManager.py +0 -300
  32. {generalmanager-0.5.1 → generalmanager-0.6.0}/GeneralManager.egg-info/dependency_links.txt +0 -0
  33. {generalmanager-0.5.1 → generalmanager-0.6.0}/GeneralManager.egg-info/requires.txt +0 -0
  34. {generalmanager-0.5.1 → generalmanager-0.6.0}/GeneralManager.egg-info/top_level.txt +0 -0
  35. {generalmanager-0.5.1 → generalmanager-0.6.0}/LICENSE +0 -0
  36. {generalmanager-0.5.1 → generalmanager-0.6.0}/setup.cfg +0 -0
  37. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/__init__.py +0 -0
  38. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/api/mutation.py +0 -0
  39. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/api/property.py +0 -0
  40. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/apps.py +0 -0
  41. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/__init__.py +0 -0
  42. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/argsToKwargs.py +0 -0
  43. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/filterParser.py +0 -0
  44. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/jsonEncoder.py +0 -0
  45. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/makeCacheKey.py +0 -0
  46. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/noneToZero.py +0 -0
  47. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/auxiliary/pathMapping.py +0 -0
  48. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/cache/cacheDecorator.py +0 -0
  49. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/cache/cacheTracker.py +0 -0
  50. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/cache/dependencyIndex.py +0 -0
  51. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/cache/signals.py +0 -0
  52. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/factory/__init__.py +0 -0
  53. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/factory/autoFactory.py +0 -0
  54. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/factory/factories.py +0 -0
  55. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/factory/factoryMethods.py +0 -0
  56. /generalmanager-0.5.1/src/general_manager/permission/fileBasedPermission.py → /generalmanager-0.6.0/src/general_manager/interface/__init__.py +0 -0
  57. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/manager/__init__.py +0 -0
  58. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/manager/input.py +0 -0
  59. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/measurement/__init__.py +0 -0
  60. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/measurement/measurement.py +0 -0
  61. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/measurement/measurementField.py +0 -0
  62. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/permission/__init__.py +0 -0
  63. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/permission/managerBasedPermission.py +0 -0
  64. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/permission/permissionChecks.py +0 -0
  65. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/permission/permissionDataManager.py +0 -0
  66. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/rule/__init__.py +0 -0
  67. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/rule/handler.py +0 -0
  68. {generalmanager-0.5.1 → generalmanager-0.6.0}/src/general_manager/rule/rule.py +0 -0
  69. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_argsToKwargs.py +0 -0
  70. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_autoFactory.py +0 -0
  71. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_basePermission.py +0 -0
  72. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_cacheDecorator.py +0 -0
  73. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_cacheTracker.py +0 -0
  74. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_dependencyIndex.py +0 -0
  75. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_factories.py +0 -0
  76. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_factoryMethods.py +0 -0
  77. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_filterParser.py +0 -0
  78. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_graph_ql.py +0 -0
  79. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_input.py +0 -0
  80. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_jsonEncoder.py +0 -0
  81. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_makeCacheKey.py +0 -0
  82. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_managerBasedPermission.py +0 -0
  83. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_measurement.py +0 -0
  84. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_measurement_field.py +0 -0
  85. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_modelDependencyCollector.py +0 -0
  86. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_noneToZero.py +0 -0
  87. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_rule_handler.py +0 -0
  88. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_rules.py +0 -0
  89. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_settings.py +0 -0
  90. {generalmanager-0.5.1 → generalmanager-0.6.0}/tests/test_signals.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GeneralManager
3
- Version: 0.5.1
4
- Summary: Kurzbeschreibung deines Pakets
3
+ Version: 0.6.0
4
+ Summary: Modular Django-based data management framework with ORM, GraphQL, fine-grained permissions, rule validation, calculations and caching.
5
5
  Author-email: Tim Kleindick <tkleindick@yahoo.de>
6
6
  License-Expression: MIT
7
7
  Requires-Python: >=3.12
@@ -37,51 +37,51 @@ Dynamic: license-file
37
37
 
38
38
  # GeneralManager
39
39
 
40
- ## Überblick
40
+ ## Overview
41
41
 
42
- Das GeneralManager-Modul ist ein leistungsstarkes und flexibles Framework, das speziell für die Verwaltung und Verarbeitung von Daten entwickelt wurde. Es bietet eine modulare Struktur, die es Entwicklern ermöglicht, komplexe Geschäftslogiken effizient zu implementieren und zu verwalten. Das Modul ist vollständig in Python geschrieben und nutzt Django als Backend-Framework.
42
+ GeneralManager is a powerful and flexible framework designed for managing and processing data. It provides a modular structure that enables developers to implement complex business logic efficiently. The module is written entirely in Python and uses Django as the backend framework.
43
43
 
44
- ## Hauptfunktionen
44
+ ## Key Features
45
45
 
46
- ### 1. **Datenmanagement**
47
- - **Flexibilität**: Unterstützt die Verwaltung aller Arten von Daten, nicht nur Projekte und Derivate.
48
- - **Datenbank-Integration**: Nahtlose Integration mit dem Django ORM für Datenbankoperationen.
49
- - **Externe Schnittstellen**: Unterstützung für Schnittstellen zu anderen Programmen, wie z. B. Excel-Interfaces.
46
+ ### 1. **Data Management**
47
+ - **Flexibility**: Supports managing all kinds of data, not just projects and derivatives.
48
+ - **Database Integration**: Seamless integration with the Django ORM for database operations.
49
+ - **External Interfaces**: Support for interfaces to other programs, such as Excel.
50
50
 
51
- ### 2. **Datenmodellierung**
52
- - **Django-Modelle**: Die Datenstruktur basiert auf Django-Modellen, die durch benutzerdefinierte Felder wie `MeasurementField` erweitert werden.
53
- - **Regeln und Validierungen**: Definieren Sie Regeln für Datenvalidierungen, z. B. dass das Startdatum eines Projekts vor dem Enddatum liegen muss.
51
+ ### 2. **Data Modeling**
52
+ - **Django Models**: The data structure is based on Django models, extended by custom fields like `MeasurementField`.
53
+ - **Rules and Validations**: Define rules for data validation, e.g., ensuring that a project's start date is before its end date.
54
54
 
55
- ### 3. **GraphQL-Integration**
56
- - Automatische Generierung von GraphQL-Schnittstellen für alle Modelle.
57
- - Unterstützung für benutzerdefinierte Abfragen und Mutationen.
55
+ ### 3. **GraphQL Integration**
56
+ - Automatic generation of GraphQL interfaces for all models.
57
+ - Support for custom queries and mutations.
58
58
 
59
- ### 4. **Berechtigungssystem**
60
- - **ManagerBasedPermission**: Ein flexibles Berechtigungssystem, das auf Benutzerrollen und Attributen basiert.
61
- - Unterstützung für CRUD-Berechtigungen auf Attributebene.
59
+ ### 4. **Permission System**
60
+ - **ManagerBasedPermission**: A flexible permission system based on user roles and attributes.
61
+ - Attribute-level CRUD permissions.
62
62
 
63
63
  ### 5. **Interfaces**
64
- - **CalculationInterface**: Ermöglicht die Implementierung von Berechnungslogiken.
65
- - **DatabaseInterface**: Bietet eine standardisierte Schnittstelle für Datenbankoperationen.
66
- - **ReadOnlyInterface**: Für schreibgeschützte Datenzugriffe.
64
+ - **CalculationInterface**: Allows the implementation of calculation logic.
65
+ - **DatabaseInterface**: Provides a standardized interface for database operations.
66
+ - **ReadOnlyInterface**: For read-only data access.
67
67
 
68
- ### 6. **Datenverteilung und Berechnung**
69
- - **Volumenverteilung**: Automatische Berechnung und Verteilung von Volumen über mehrere Jahre.
70
- - **Kommerzielle Berechnungen**: Berechnung von Gesamtvolumen, Versandkosten und Einnahmen für Projekte.
68
+ ### 6. **Data Distribution and Calculations**
69
+ - **Volume Distribution**: Automatically calculates and distributes volume over multiple years.
70
+ - **Commercial Calculations**: Calculates total volume, shipping costs, and revenue for projects.
71
71
 
72
- ## Anwendung
72
+ ## Usage
73
73
 
74
74
  ### Installation
75
75
 
76
- Installieren Sie das Modul über `pip`:
76
+ Install the module via `pip`:
77
77
 
78
78
  ```bash
79
79
  pip install GeneralManager
80
80
  ```
81
81
 
82
- ### Beispielcode
82
+ ### Example Code
83
83
 
84
- Hier ist ein Beispiel, wie Sie einen GeneralManager erstellen und Testdaten (in diesem Fall 10 Projekte) generieren können:
84
+ The following example demonstrates how to create a GeneralManager and generate sample data (in this case 10 projects):
85
85
 
86
86
  ```python
87
87
  from general_manager import GeneralManager
@@ -134,11 +134,11 @@ class Project(GeneralManager):
134
134
  Project.Factory.createBatch(10)
135
135
  ```
136
136
 
137
- ### GraphQL-Integration
137
+ ### GraphQL Integration
138
138
 
139
- Das Modul generiert automatisch GraphQL-Schnittstellen für alle Modelle. Sie können Abfragen und Mutationen über die GraphQL-URL ausführen, die in den Django-Einstellungen definiert ist.
139
+ The module automatically generates GraphQL endpoints for all models. You can run queries and mutations through the GraphQL URL defined in your Django settings.
140
140
 
141
- Beispiel für eine GraphQL-Abfrage:
141
+ Example of a GraphQL query:
142
142
 
143
143
  ```graphql
144
144
  query {
@@ -154,26 +154,26 @@ query {
154
154
  }
155
155
  ```
156
156
 
157
- ## Vorteile
157
+ ## Benefits
158
158
 
159
- - **Modularität**: Einfach erweiterbar und anpassbar.
160
- - **Flexibilität**: Unterstützt komplexe Geschäftslogiken und Berechnungen.
161
- - **Integration**: Nahtlose Integration mit Django und GraphQL.
162
- - **Berechtigungen**: Fein abgestimmte Berechtigungen für Benutzer und Attribute.
163
- - **Datenvalidierung**: Automatische Validierung von Daten durch Regeln und Constraints.
164
- - **Caching**: Automatische Cache-Generierung mit @cached Decorator, um die Leistung zu verbessern.
159
+ - **Modularity**: Easy to extend and adapt.
160
+ - **Flexibility**: Supports complex business logic and calculations.
161
+ - **Integration**: Seamless integration with Django and GraphQL.
162
+ - **Permissions**: Fine-grained permissions for users and attributes.
163
+ - **Data Validation**: Automatic validation of data through rules and constraints.
164
+ - **Caching**: Automatic cache generation with the `@cached` decorator to improve performance.
165
165
 
166
- ## Anforderungen
166
+ ## Requirements
167
167
 
168
168
  - Python >= 3.12
169
169
  - Django >= 5.2
170
- - Zusätzliche Abhängigkeiten (siehe `requirements.txt`):
170
+ - Additional dependencies (see `requirements.txt`):
171
171
  - `graphene`
172
172
  - `numpy`
173
173
  - `Pint`
174
174
  - `factory_boy`
175
- - uvm.
175
+ - and more.
176
176
 
177
- ## Lizenz
177
+ ## License
178
178
 
179
- Dieses Projekt steht unter der **Non-Commercial MIT License**. Es darf nur für nicht-kommerzielle Zwecke verwendet werden. Weitere Details finden Sie in der [LICENSE](./LICENSE).
179
+ This project is distributed under the **Non-Commercial MIT License**. It may only be used for non-commercial purposes. For further details see the [LICENSE](./LICENSE) file.
@@ -18,6 +18,10 @@ src/general_manager/auxiliary/jsonEncoder.py
18
18
  src/general_manager/auxiliary/makeCacheKey.py
19
19
  src/general_manager/auxiliary/noneToZero.py
20
20
  src/general_manager/auxiliary/pathMapping.py
21
+ src/general_manager/bucket/baseBucket.py
22
+ src/general_manager/bucket/calculationBucket.py
23
+ src/general_manager/bucket/databaseBucket.py
24
+ src/general_manager/bucket/groupBucket.py
21
25
  src/general_manager/cache/cacheDecorator.py
22
26
  src/general_manager/cache/cacheTracker.py
23
27
  src/general_manager/cache/dependencyIndex.py
@@ -30,7 +34,9 @@ src/general_manager/factory/factoryMethods.py
30
34
  src/general_manager/interface/__init__.py
31
35
  src/general_manager/interface/baseInterface.py
32
36
  src/general_manager/interface/calculationInterface.py
37
+ src/general_manager/interface/databaseBasedInterface.py
33
38
  src/general_manager/interface/databaseInterface.py
39
+ src/general_manager/interface/readOnlyInterface.py
34
40
  src/general_manager/manager/__init__.py
35
41
  src/general_manager/manager/generalManager.py
36
42
  src/general_manager/manager/groupManager.py
@@ -50,9 +56,13 @@ src/general_manager/rule/handler.py
50
56
  src/general_manager/rule/rule.py
51
57
  tests/test_argsToKwargs.py
52
58
  tests/test_autoFactory.py
59
+ tests/test_baseBucket.py
60
+ tests/test_baseInterface.py
53
61
  tests/test_basePermission.py
54
62
  tests/test_cacheDecorator.py
55
63
  tests/test_cacheTracker.py
64
+ tests/test_dabaseBasedInterface.py
65
+ tests/test_databaseBucket.py
56
66
  tests/test_dependencyIndex.py
57
67
  tests/test_factories.py
58
68
  tests/test_factoryMethods.py
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GeneralManager
3
- Version: 0.5.1
4
- Summary: Kurzbeschreibung deines Pakets
3
+ Version: 0.6.0
4
+ Summary: Modular Django-based data management framework with ORM, GraphQL, fine-grained permissions, rule validation, calculations and caching.
5
5
  Author-email: Tim Kleindick <tkleindick@yahoo.de>
6
6
  License-Expression: MIT
7
7
  Requires-Python: >=3.12
@@ -37,51 +37,51 @@ Dynamic: license-file
37
37
 
38
38
  # GeneralManager
39
39
 
40
- ## Überblick
40
+ ## Overview
41
41
 
42
- Das GeneralManager-Modul ist ein leistungsstarkes und flexibles Framework, das speziell für die Verwaltung und Verarbeitung von Daten entwickelt wurde. Es bietet eine modulare Struktur, die es Entwicklern ermöglicht, komplexe Geschäftslogiken effizient zu implementieren und zu verwalten. Das Modul ist vollständig in Python geschrieben und nutzt Django als Backend-Framework.
42
+ GeneralManager is a powerful and flexible framework designed for managing and processing data. It provides a modular structure that enables developers to implement complex business logic efficiently. The module is written entirely in Python and uses Django as the backend framework.
43
43
 
44
- ## Hauptfunktionen
44
+ ## Key Features
45
45
 
46
- ### 1. **Datenmanagement**
47
- - **Flexibilität**: Unterstützt die Verwaltung aller Arten von Daten, nicht nur Projekte und Derivate.
48
- - **Datenbank-Integration**: Nahtlose Integration mit dem Django ORM für Datenbankoperationen.
49
- - **Externe Schnittstellen**: Unterstützung für Schnittstellen zu anderen Programmen, wie z. B. Excel-Interfaces.
46
+ ### 1. **Data Management**
47
+ - **Flexibility**: Supports managing all kinds of data, not just projects and derivatives.
48
+ - **Database Integration**: Seamless integration with the Django ORM for database operations.
49
+ - **External Interfaces**: Support for interfaces to other programs, such as Excel.
50
50
 
51
- ### 2. **Datenmodellierung**
52
- - **Django-Modelle**: Die Datenstruktur basiert auf Django-Modellen, die durch benutzerdefinierte Felder wie `MeasurementField` erweitert werden.
53
- - **Regeln und Validierungen**: Definieren Sie Regeln für Datenvalidierungen, z. B. dass das Startdatum eines Projekts vor dem Enddatum liegen muss.
51
+ ### 2. **Data Modeling**
52
+ - **Django Models**: The data structure is based on Django models, extended by custom fields like `MeasurementField`.
53
+ - **Rules and Validations**: Define rules for data validation, e.g., ensuring that a project's start date is before its end date.
54
54
 
55
- ### 3. **GraphQL-Integration**
56
- - Automatische Generierung von GraphQL-Schnittstellen für alle Modelle.
57
- - Unterstützung für benutzerdefinierte Abfragen und Mutationen.
55
+ ### 3. **GraphQL Integration**
56
+ - Automatic generation of GraphQL interfaces for all models.
57
+ - Support for custom queries and mutations.
58
58
 
59
- ### 4. **Berechtigungssystem**
60
- - **ManagerBasedPermission**: Ein flexibles Berechtigungssystem, das auf Benutzerrollen und Attributen basiert.
61
- - Unterstützung für CRUD-Berechtigungen auf Attributebene.
59
+ ### 4. **Permission System**
60
+ - **ManagerBasedPermission**: A flexible permission system based on user roles and attributes.
61
+ - Attribute-level CRUD permissions.
62
62
 
63
63
  ### 5. **Interfaces**
64
- - **CalculationInterface**: Ermöglicht die Implementierung von Berechnungslogiken.
65
- - **DatabaseInterface**: Bietet eine standardisierte Schnittstelle für Datenbankoperationen.
66
- - **ReadOnlyInterface**: Für schreibgeschützte Datenzugriffe.
64
+ - **CalculationInterface**: Allows the implementation of calculation logic.
65
+ - **DatabaseInterface**: Provides a standardized interface for database operations.
66
+ - **ReadOnlyInterface**: For read-only data access.
67
67
 
68
- ### 6. **Datenverteilung und Berechnung**
69
- - **Volumenverteilung**: Automatische Berechnung und Verteilung von Volumen über mehrere Jahre.
70
- - **Kommerzielle Berechnungen**: Berechnung von Gesamtvolumen, Versandkosten und Einnahmen für Projekte.
68
+ ### 6. **Data Distribution and Calculations**
69
+ - **Volume Distribution**: Automatically calculates and distributes volume over multiple years.
70
+ - **Commercial Calculations**: Calculates total volume, shipping costs, and revenue for projects.
71
71
 
72
- ## Anwendung
72
+ ## Usage
73
73
 
74
74
  ### Installation
75
75
 
76
- Installieren Sie das Modul über `pip`:
76
+ Install the module via `pip`:
77
77
 
78
78
  ```bash
79
79
  pip install GeneralManager
80
80
  ```
81
81
 
82
- ### Beispielcode
82
+ ### Example Code
83
83
 
84
- Hier ist ein Beispiel, wie Sie einen GeneralManager erstellen und Testdaten (in diesem Fall 10 Projekte) generieren können:
84
+ The following example demonstrates how to create a GeneralManager and generate sample data (in this case 10 projects):
85
85
 
86
86
  ```python
87
87
  from general_manager import GeneralManager
@@ -134,11 +134,11 @@ class Project(GeneralManager):
134
134
  Project.Factory.createBatch(10)
135
135
  ```
136
136
 
137
- ### GraphQL-Integration
137
+ ### GraphQL Integration
138
138
 
139
- Das Modul generiert automatisch GraphQL-Schnittstellen für alle Modelle. Sie können Abfragen und Mutationen über die GraphQL-URL ausführen, die in den Django-Einstellungen definiert ist.
139
+ The module automatically generates GraphQL endpoints for all models. You can run queries and mutations through the GraphQL URL defined in your Django settings.
140
140
 
141
- Beispiel für eine GraphQL-Abfrage:
141
+ Example of a GraphQL query:
142
142
 
143
143
  ```graphql
144
144
  query {
@@ -154,26 +154,26 @@ query {
154
154
  }
155
155
  ```
156
156
 
157
- ## Vorteile
157
+ ## Benefits
158
158
 
159
- - **Modularität**: Einfach erweiterbar und anpassbar.
160
- - **Flexibilität**: Unterstützt komplexe Geschäftslogiken und Berechnungen.
161
- - **Integration**: Nahtlose Integration mit Django und GraphQL.
162
- - **Berechtigungen**: Fein abgestimmte Berechtigungen für Benutzer und Attribute.
163
- - **Datenvalidierung**: Automatische Validierung von Daten durch Regeln und Constraints.
164
- - **Caching**: Automatische Cache-Generierung mit @cached Decorator, um die Leistung zu verbessern.
159
+ - **Modularity**: Easy to extend and adapt.
160
+ - **Flexibility**: Supports complex business logic and calculations.
161
+ - **Integration**: Seamless integration with Django and GraphQL.
162
+ - **Permissions**: Fine-grained permissions for users and attributes.
163
+ - **Data Validation**: Automatic validation of data through rules and constraints.
164
+ - **Caching**: Automatic cache generation with the `@cached` decorator to improve performance.
165
165
 
166
- ## Anforderungen
166
+ ## Requirements
167
167
 
168
168
  - Python >= 3.12
169
169
  - Django >= 5.2
170
- - Zusätzliche Abhängigkeiten (siehe `requirements.txt`):
170
+ - Additional dependencies (see `requirements.txt`):
171
171
  - `graphene`
172
172
  - `numpy`
173
173
  - `Pint`
174
174
  - `factory_boy`
175
- - uvm.
175
+ - and more.
176
176
 
177
- ## Lizenz
177
+ ## License
178
178
 
179
- Dieses Projekt steht unter der **Non-Commercial MIT License**. Es darf nur für nicht-kommerzielle Zwecke verwendet werden. Weitere Details finden Sie in der [LICENSE](./LICENSE).
179
+ This project is distributed under the **Non-Commercial MIT License**. It may only be used for non-commercial purposes. For further details see the [LICENSE](./LICENSE) file.
@@ -0,0 +1,142 @@
1
+ # GeneralManager
2
+
3
+ ## Overview
4
+
5
+ GeneralManager is a powerful and flexible framework designed for managing and processing data. It provides a modular structure that enables developers to implement complex business logic efficiently. The module is written entirely in Python and uses Django as the backend framework.
6
+
7
+ ## Key Features
8
+
9
+ ### 1. **Data Management**
10
+ - **Flexibility**: Supports managing all kinds of data, not just projects and derivatives.
11
+ - **Database Integration**: Seamless integration with the Django ORM for database operations.
12
+ - **External Interfaces**: Support for interfaces to other programs, such as Excel.
13
+
14
+ ### 2. **Data Modeling**
15
+ - **Django Models**: The data structure is based on Django models, extended by custom fields like `MeasurementField`.
16
+ - **Rules and Validations**: Define rules for data validation, e.g., ensuring that a project's start date is before its end date.
17
+
18
+ ### 3. **GraphQL Integration**
19
+ - Automatic generation of GraphQL interfaces for all models.
20
+ - Support for custom queries and mutations.
21
+
22
+ ### 4. **Permission System**
23
+ - **ManagerBasedPermission**: A flexible permission system based on user roles and attributes.
24
+ - Attribute-level CRUD permissions.
25
+
26
+ ### 5. **Interfaces**
27
+ - **CalculationInterface**: Allows the implementation of calculation logic.
28
+ - **DatabaseInterface**: Provides a standardized interface for database operations.
29
+ - **ReadOnlyInterface**: For read-only data access.
30
+
31
+ ### 6. **Data Distribution and Calculations**
32
+ - **Volume Distribution**: Automatically calculates and distributes volume over multiple years.
33
+ - **Commercial Calculations**: Calculates total volume, shipping costs, and revenue for projects.
34
+
35
+ ## Usage
36
+
37
+ ### Installation
38
+
39
+ Install the module via `pip`:
40
+
41
+ ```bash
42
+ pip install GeneralManager
43
+ ```
44
+
45
+ ### Example Code
46
+
47
+ The following example demonstrates how to create a GeneralManager and generate sample data (in this case 10 projects):
48
+
49
+ ```python
50
+ from general_manager import GeneralManager
51
+ from general_manager.interface.database import DatabaseInterface
52
+ from general_manager.measurement import MeasurementField, Measurement
53
+ from general_manager.permission import ManagerBasedPermission
54
+
55
+ class Project(GeneralManager):
56
+ name: str
57
+ start_date: Optional[date]
58
+ end_date: Optional[date]
59
+ total_capex: Optional[Measurement]
60
+ derivative_list: DatabaseBucket[Derivative]
61
+
62
+ class Interface(DatabaseInterface):
63
+ name = CharField(max_length=50)
64
+ number = CharField(max_length=7, validators=[RegexValidator(r"^AP\d{4,5}$")])
65
+ description = TextField(null=True, blank=True)
66
+ start_date = DateField(null=True, blank=True)
67
+ end_date = DateField(null=True, blank=True)
68
+ total_capex = MeasurementField(base_unit="EUR", null=True, blank=True)
69
+
70
+ class Meta:
71
+ constraints = [
72
+ constraints.UniqueConstraint(
73
+ fields=["name", "number"], name="unique_booking"
74
+ )
75
+ ]
76
+
77
+ rules = [
78
+ Rule["Project"](
79
+ lambda x: cast(date, x.start_date) < cast(date, x.end_date)
80
+ ),
81
+ Rule["Project"](lambda x: cast(Measurement, x.total_capex) >= "0 EUR"),
82
+ ]
83
+
84
+ class Factory:
85
+ name = LazyProjectName()
86
+ end_date = LazyDeltaDate(365 * 6, "start_date")
87
+ total_capex = LazyMeasurement(75_000, 1_000_000, "EUR")
88
+
89
+ class Permission(ManagerBasedPermission):
90
+ __read__ = ["ends_with:name:X-771", "public"]
91
+ __create__ = ["admin", "isMatchingKeyAccount"]
92
+ __update__ = ["admin", "isMatchingKeyAccount", "isProjectTeamMember"]
93
+ __delete__ = ["admin", "isMatchingKeyAccount", "isProjectTeamMember"]
94
+
95
+ total_capex = {"update": ["isSalesResponsible", "isProjectManager"]}
96
+
97
+ Project.Factory.createBatch(10)
98
+ ```
99
+
100
+ ### GraphQL Integration
101
+
102
+ The module automatically generates GraphQL endpoints for all models. You can run queries and mutations through the GraphQL URL defined in your Django settings.
103
+
104
+ Example of a GraphQL query:
105
+
106
+ ```graphql
107
+ query {
108
+ projectList {
109
+ name
110
+ startDate
111
+ endDate
112
+ totalCapex {
113
+ value
114
+ unit
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## Benefits
121
+
122
+ - **Modularity**: Easy to extend and adapt.
123
+ - **Flexibility**: Supports complex business logic and calculations.
124
+ - **Integration**: Seamless integration with Django and GraphQL.
125
+ - **Permissions**: Fine-grained permissions for users and attributes.
126
+ - **Data Validation**: Automatic validation of data through rules and constraints.
127
+ - **Caching**: Automatic cache generation with the `@cached` decorator to improve performance.
128
+
129
+ ## Requirements
130
+
131
+ - Python >= 3.12
132
+ - Django >= 5.2
133
+ - Additional dependencies (see `requirements.txt`):
134
+ - `graphene`
135
+ - `numpy`
136
+ - `Pint`
137
+ - `factory_boy`
138
+ - and more.
139
+
140
+ ## License
141
+
142
+ This project is distributed under the **Non-Commercial MIT License**. It may only be used for non-commercial purposes. For further details see the [LICENSE](./LICENSE) file.
@@ -1,18 +1,13 @@
1
1
  [build-system]
2
- requires = [
3
- "setuptools>=42",
4
- "wheel",
5
- ]
2
+ requires = ["setuptools>=42", "wheel"]
6
3
  build-backend = "setuptools.build_meta"
7
4
 
8
5
  [project]
9
6
  name = "GeneralManager"
10
- version = "0.5.1"
11
- description = "Kurzbeschreibung deines Pakets"
7
+ version = "0.6.0"
8
+ description = "Modular Django-based data management framework with ORM, GraphQL, fine-grained permissions, rule validation, calculations and caching."
12
9
  readme = "README.md"
13
- authors = [
14
- { name = "Tim Kleindick", email = "tkleindick@yahoo.de" },
15
- ]
10
+ authors = [{ name = "Tim Kleindick", email = "tkleindick@yahoo.de" }]
16
11
  license = "MIT"
17
12
  license-files = ["LICENSE"]
18
13
  requires-python = ">=3.12"
@@ -46,19 +41,16 @@ dependencies = [
46
41
  ]
47
42
 
48
43
  [tool.setuptools.packages.find]
49
- where = [
50
- "src",
51
- "general_manager",
52
- ]
44
+ where = ["src", "general_manager"]
53
45
 
54
46
  [tool.semantic_release]
55
- allow_zero_version = true
56
- major_on_zero = false
57
- version_toml = ["pyproject.toml:project.version"]
58
- branch = "main"
59
- build_command = "python -m build"
60
- upload_to_PyPI = true
61
- upload_to_release = true
47
+ allow_zero_version = true
48
+ major_on_zero = false
49
+ version_toml = ["pyproject.toml:project.version"]
50
+ branch = "main"
51
+ build_command = "python -m build"
52
+ upload_to_PyPI = true
53
+ upload_to_release = true
62
54
 
63
55
  [tool.semantic_release.remote]
64
56
  ignore_token_for_push = true
@@ -9,7 +9,8 @@ import json
9
9
  from general_manager.measurement.measurement import Measurement
10
10
  from general_manager.manager.generalManager import GeneralManagerMeta, GeneralManager
11
11
  from general_manager.api.property import GraphQLProperty
12
- from general_manager.interface.baseInterface import InterfaceBase, Bucket
12
+ from general_manager.bucket.baseBucket import Bucket
13
+ from general_manager.interface.baseInterface import InterfaceBase
13
14
 
14
15
  if TYPE_CHECKING:
15
16
  from general_manager.permission.basePermission import BasePermission