GeneralManager 0.11.0__tar.gz → 0.11.1__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.
- {generalmanager-0.11.0 → generalmanager-0.11.1}/GeneralManager.egg-info/PKG-INFO +1 -1
- {generalmanager-0.11.0 → generalmanager-0.11.1}/PKG-INFO +1 -1
- {generalmanager-0.11.0 → generalmanager-0.11.1}/pyproject.toml +1 -1
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/databaseBasedInterface.py +20 -14
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/manager/generalManager.py +13 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/GeneralManager.egg-info/SOURCES.txt +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/GeneralManager.egg-info/dependency_links.txt +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/GeneralManager.egg-info/requires.txt +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/GeneralManager.egg-info/top_level.txt +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/LICENSE +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/README.md +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/setup.cfg +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/api/graphql.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/api/mutation.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/api/property.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/apps.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/bucket/baseBucket.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/bucket/calculationBucket.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/bucket/databaseBucket.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/bucket/groupBucket.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/cache/cacheDecorator.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/cache/cacheTracker.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/cache/dependencyIndex.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/cache/modelDependencyCollector.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/cache/signals.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/factory/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/factory/autoFactory.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/factory/factories.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/factory/factoryMethods.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/baseInterface.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/calculationInterface.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/databaseInterface.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/models.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/readOnlyInterface.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/manager/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/manager/groupManager.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/manager/input.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/manager/meta.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/measurement/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/measurement/measurement.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/measurement/measurementField.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/basePermission.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/fileBasedPermission.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/managerBasedPermission.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/mutationPermission.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/permissionChecks.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/permissionDataManager.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/utils.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/rule/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/rule/handler.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/rule/rule.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/__init__.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/argsToKwargs.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/filterParser.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/formatString.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/jsonEncoder.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/makeCacheKey.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/noneToZero.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/pathMapping.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/utils/testing.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/tests/test_settings.py +0 -0
- {generalmanager-0.11.0 → generalmanager-0.11.1}/tests/test_urls.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: GeneralManager
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.1
|
4
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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: GeneralManager
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.1
|
4
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
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "GeneralManager"
|
7
|
-
version = "0.11.
|
7
|
+
version = "0.11.1"
|
8
8
|
description = "Modular Django-based data management framework with ORM, GraphQL, fine-grained permissions, rule validation, calculations and caching."
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [{ name = "Tim Kleindick", email = "tkleindick@yahoo.de" }]
|
@@ -47,7 +47,7 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
47
47
|
):
|
48
48
|
"""
|
49
49
|
Initialize the interface and load the associated model instance by primary key.
|
50
|
-
|
50
|
+
|
51
51
|
If a `search_date` is provided, retrieves the historical record as of that date; otherwise, loads the current record.
|
52
52
|
"""
|
53
53
|
super().__init__(*args, **kwargs)
|
@@ -136,9 +136,9 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
136
136
|
def getAttributeTypes(cls) -> dict[str, AttributeTypedDict]:
|
137
137
|
"""
|
138
138
|
Return a dictionary mapping each attribute name of the model to its type information and metadata.
|
139
|
-
|
139
|
+
|
140
140
|
The returned dictionary includes all standard model fields, custom fields, foreign keys, many-to-many, and reverse relation fields, excluding any GenericForeignKey fields. For each attribute, the metadata specifies its Python type (translated from Django field types when possible), whether it is required, editable, derived, and its default value. For related models with a general manager class, the type is set to that class.
|
141
|
-
|
141
|
+
|
142
142
|
Returns:
|
143
143
|
dict[str, AttributeTypedDict]: Mapping of attribute names to their type information and metadata.
|
144
144
|
"""
|
@@ -248,12 +248,14 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
248
248
|
def getAttributes(cls) -> dict[str, Callable[[DBBasedInterface], Any]]:
|
249
249
|
"""
|
250
250
|
Return a dictionary mapping attribute names to callables that retrieve values from a DBBasedInterface instance.
|
251
|
-
|
251
|
+
|
252
252
|
The mapping includes accessors for custom fields, standard model fields, foreign keys, many-to-many relations, and reverse relations. For related models with a general manager class, the accessor returns an instance of that class; otherwise, it returns the related object or queryset. Raises a ValueError if a field name conflict is detected.
|
253
|
-
|
253
|
+
|
254
254
|
Returns:
|
255
255
|
dict: A dictionary where keys are attribute names and values are callables that extract the corresponding value from a DBBasedInterface instance.
|
256
256
|
"""
|
257
|
+
from general_manager.manager.generalManager import GeneralManager
|
258
|
+
|
257
259
|
field_values: dict[str, Any] = {}
|
258
260
|
|
259
261
|
field_name_list, to_ignore_list = cls.handleCustomFields(cls._model)
|
@@ -274,10 +276,14 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
274
276
|
related_model,
|
275
277
|
"_general_manager_class",
|
276
278
|
):
|
277
|
-
generalManagerClass =
|
279
|
+
generalManagerClass = cast(
|
280
|
+
Type[GeneralManager], related_model._general_manager_class
|
281
|
+
)
|
278
282
|
field_values[f"{field_name}"] = (
|
279
|
-
lambda self, field_name=field_name, manager_class=generalManagerClass:
|
280
|
-
getattr(self._instance, field_name).pk
|
283
|
+
lambda self, field_name=field_name, manager_class=generalManagerClass: (
|
284
|
+
manager_class(getattr(self._instance, field_name).pk)
|
285
|
+
if getattr(self._instance, field_name)
|
286
|
+
else None
|
281
287
|
)
|
282
288
|
)
|
283
289
|
else:
|
@@ -339,10 +345,10 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
339
345
|
def _getCustomFields(model: Type[models.Model] | models.Model) -> list[str]:
|
340
346
|
"""
|
341
347
|
Return a list of custom field names defined directly as class attributes on the given Django model.
|
342
|
-
|
348
|
+
|
343
349
|
Parameters:
|
344
350
|
model: The Django model class or instance to inspect.
|
345
|
-
|
351
|
+
|
346
352
|
Returns:
|
347
353
|
A list of field names for fields declared directly on the model class, excluding those defined via Django's meta system.
|
348
354
|
"""
|
@@ -356,7 +362,7 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
356
362
|
def __getModelFields(cls) -> list[str]:
|
357
363
|
"""
|
358
364
|
Return a list of field names for the model that are neither many-to-many nor related fields.
|
359
|
-
|
365
|
+
|
360
366
|
Fields representing many-to-many relationships or relations to other models are excluded from the result.
|
361
367
|
"""
|
362
368
|
return [
|
@@ -380,7 +386,7 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
380
386
|
def __getManyToManyFields(cls) -> list[tuple[str, str]]:
|
381
387
|
"""
|
382
388
|
Return a list of tuples representing all many-to-many fields on the model.
|
383
|
-
|
389
|
+
|
384
390
|
Each tuple contains the field name twice. Fields that are generic foreign keys are excluded.
|
385
391
|
"""
|
386
392
|
return [
|
@@ -393,7 +399,7 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
393
399
|
def __getReverseRelations(cls) -> list[tuple[str, str]]:
|
394
400
|
"""
|
395
401
|
Return a list of reverse one-to-many relations for the model, excluding generic foreign keys.
|
396
|
-
|
402
|
+
|
397
403
|
Each tuple contains the related field's name and its default related accessor name (e.g., `fieldname_set`).
|
398
404
|
"""
|
399
405
|
return [
|
@@ -502,7 +508,7 @@ class DBBasedInterface(InterfaceBase, Generic[MODEL_TYPE]):
|
|
502
508
|
def getFieldType(cls, field_name: str) -> type:
|
503
509
|
"""
|
504
510
|
Return the type associated with a given model field name.
|
505
|
-
|
511
|
+
|
506
512
|
If the field is a relation and its related model has a `_general_manager_class` attribute, that class is returned; otherwise, returns the Django field type.
|
507
513
|
"""
|
508
514
|
field = cls._model._meta.get_field(field_name)
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/manager/generalManager.py
RENAMED
@@ -58,6 +58,19 @@ class GeneralManager(metaclass=GeneralManagerMeta):
|
|
58
58
|
else:
|
59
59
|
raise TypeError(f"Unsupported type for union: {type(other)}")
|
60
60
|
|
61
|
+
def __eq__(
|
62
|
+
self,
|
63
|
+
other: object,
|
64
|
+
) -> bool:
|
65
|
+
"""
|
66
|
+
Check equality based on the identification dictionary.
|
67
|
+
|
68
|
+
Returns True if the other object is a GeneralManager with the same identification, otherwise False.
|
69
|
+
"""
|
70
|
+
if not isinstance(other, GeneralManager):
|
71
|
+
return False
|
72
|
+
return self.identification == other.identification
|
73
|
+
|
61
74
|
@property
|
62
75
|
def identification(self):
|
63
76
|
return self.__id
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/GeneralManager.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/bucket/calculationBucket.py
RENAMED
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/bucket/databaseBucket.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/cache/dependencyIndex.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/factory/factoryMethods.py
RENAMED
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/baseInterface.py
RENAMED
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/databaseInterface.py
RENAMED
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/interface/readOnlyInterface.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/measurement/measurement.py
RENAMED
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/measurement/measurementField.py
RENAMED
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/basePermission.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/mutationPermission.py
RENAMED
File without changes
|
{generalmanager-0.11.0 → generalmanager-0.11.1}/src/general_manager/permission/permissionChecks.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|