GeneralManager 0.10.1__py3-none-any.whl → 0.10.2__py3-none-any.whl
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.
- general_manager/api/mutation.py +14 -4
- general_manager/interface/databaseBasedInterface.py +1 -6
- {generalmanager-0.10.1.dist-info → generalmanager-0.10.2.dist-info}/METADATA +1 -1
- {generalmanager-0.10.1.dist-info → generalmanager-0.10.2.dist-info}/RECORD +7 -7
- {generalmanager-0.10.1.dist-info → generalmanager-0.10.2.dist-info}/WHEEL +0 -0
- {generalmanager-0.10.1.dist-info → generalmanager-0.10.2.dist-info}/licenses/LICENSE +0 -0
- {generalmanager-0.10.1.dist-info → generalmanager-0.10.2.dist-info}/top_level.txt +0 -0
general_manager/api/mutation.py
CHANGED
@@ -6,6 +6,7 @@ from general_manager.api.graphql import GraphQL
|
|
6
6
|
from general_manager.manager.generalManager import GeneralManager
|
7
7
|
|
8
8
|
from general_manager.utils.formatString import snake_to_camel
|
9
|
+
from typing import TypeAliasType
|
9
10
|
|
10
11
|
|
11
12
|
def graphQlMutation(needs_role: Optional[str] = None, auth_required: bool = False):
|
@@ -56,15 +57,17 @@ def graphQlMutation(needs_role: Optional[str] = None, auth_required: bool = Fals
|
|
56
57
|
required = False
|
57
58
|
# extract inner type
|
58
59
|
ann = [a for a in get_args(ann) if a is not type(None)][0]
|
60
|
+
kwargs["required"] = False
|
59
61
|
|
60
62
|
# Resolve list types to List scalar
|
61
63
|
if get_origin(ann) is list or get_origin(ann) is List:
|
62
64
|
inner = get_args(ann)[0]
|
63
65
|
field = graphene.List(
|
64
|
-
GraphQL._mapFieldToGrapheneBaseType(inner)
|
66
|
+
GraphQL._mapFieldToGrapheneBaseType(inner),
|
67
|
+
**kwargs,
|
65
68
|
)
|
66
69
|
else:
|
67
|
-
if
|
70
|
+
if inspect.isclass(ann) and issubclass(ann, GeneralManager):
|
68
71
|
field = graphene.ID(**kwargs)
|
69
72
|
else:
|
70
73
|
field = GraphQL._mapFieldToGrapheneBaseType(ann)(**kwargs)
|
@@ -89,13 +92,20 @@ def graphQlMutation(needs_role: Optional[str] = None, auth_required: bool = Fals
|
|
89
92
|
else [return_ann]
|
90
93
|
)
|
91
94
|
for out in out_types:
|
92
|
-
|
95
|
+
is_named_type = isinstance(out, TypeAliasType)
|
96
|
+
is_type = isinstance(out, type)
|
97
|
+
if not is_type and not is_named_type:
|
93
98
|
raise TypeError(
|
94
99
|
f"Mutation {fn.__name__} return type {out} is not a type"
|
95
100
|
)
|
96
101
|
name = out.__name__
|
97
102
|
field_name = name[0].lower() + name[1:]
|
98
|
-
|
103
|
+
|
104
|
+
basis_type = out.__value__ if is_named_type else out
|
105
|
+
|
106
|
+
outputs[field_name] = GraphQL._mapFieldToGrapheneRead(
|
107
|
+
basis_type, field_name
|
108
|
+
)
|
99
109
|
|
100
110
|
# Define mutate method
|
101
111
|
def _mutate(root, info, **kwargs):
|
@@ -1,14 +1,11 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from typing import Type,
|
2
|
+
from typing import Type, Any, Callable, TYPE_CHECKING, TypeVar, Generic
|
3
3
|
from django.db import models
|
4
|
-
from django.conf import settings
|
5
4
|
from datetime import datetime, timedelta
|
6
|
-
from simple_history.models import HistoricalRecords # type: ignore
|
7
5
|
from general_manager.measurement.measurement import Measurement
|
8
6
|
from general_manager.measurement.measurementField import MeasurementField
|
9
7
|
from decimal import Decimal
|
10
8
|
from general_manager.factory.autoFactory import AutoFactory
|
11
|
-
from django.core.exceptions import ValidationError
|
12
9
|
from general_manager.interface.baseInterface import (
|
13
10
|
InterfaceBase,
|
14
11
|
classPostCreationMethod,
|
@@ -30,8 +27,6 @@ from general_manager.interface.models import (
|
|
30
27
|
)
|
31
28
|
|
32
29
|
if TYPE_CHECKING:
|
33
|
-
from general_manager.manager.generalManager import GeneralManager
|
34
|
-
from django.contrib.auth.models import AbstractUser
|
35
30
|
from general_manager.rule.rule import Rule
|
36
31
|
|
37
32
|
modelsModel = TypeVar("modelsModel", bound=models.Model)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: GeneralManager
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.2
|
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,7 +1,7 @@
|
|
1
1
|
general_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
general_manager/apps.py,sha256=dNzdcOTLs53y7JAGjQ7rqY1VWLtwO43NTTGJhbmbq1s,9906
|
3
3
|
general_manager/api/graphql.py,sha256=ZMzlpgmyn2X9Zwxo12r-b5UZ2R-u1pXys_nhNczxyX8,31622
|
4
|
-
general_manager/api/mutation.py,sha256=
|
4
|
+
general_manager/api/mutation.py,sha256=RvKp4OnV70q4Dqmu407Cd0FXgD12WdbRgzYCS4qd_bg,5990
|
5
5
|
general_manager/api/property.py,sha256=oc93p1P8dcIvrNorRuqD1EJVsd6eYttYhZuAS0s28gs,696
|
6
6
|
general_manager/bucket/baseBucket.py,sha256=65oQbSE6C8TE0yVPP_Aoi_Fwq0Uo2TLVPWMG6l2qxyQ,7836
|
7
7
|
general_manager/bucket/calculationBucket.py,sha256=7AjoqdTOrbUCfWu7kZDjtu7vaFFJ7SPHELvtOZ8wfQg,18578
|
@@ -19,7 +19,7 @@ general_manager/factory/factoryMethods.py,sha256=9Bag891j0XHe3dUBAFi7gUKcKeUwcBZ
|
|
19
19
|
general_manager/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
general_manager/interface/baseInterface.py,sha256=IWEtY--IuFiB3cjrCgtyXBTMpAPTayiFDnRQY7JZeaw,8600
|
21
21
|
general_manager/interface/calculationInterface.py,sha256=Kg_OqLw67tcLwdzYNLq31eKVLzkM7taw-8Mzmk0CYi0,4232
|
22
|
-
general_manager/interface/databaseBasedInterface.py,sha256=
|
22
|
+
general_manager/interface/databaseBasedInterface.py,sha256=fm5G-AVuTzAa59YwQRiFRGvy-DqsZZ3AfIBG9mls4sg,20398
|
23
23
|
general_manager/interface/databaseInterface.py,sha256=rhKVXhg0ztdIxKikTWtgjrkA7cwZTOYlEsRh0RWajDQ,6732
|
24
24
|
general_manager/interface/models.py,sha256=gGYW5f1AUBpBakV3O0qsZwqMiWxZGdKRYXWaCBjt1oI,3334
|
25
25
|
general_manager/interface/readOnlyInterface.py,sha256=TkfbOeaa2wCq5kCv0a3IwJWcYOTVbtNsdNWmGAz0Mns,11217
|
@@ -49,8 +49,8 @@ general_manager/utils/makeCacheKey.py,sha256=UlFsxHXgsYy69AAelkF6GDvY4h7AImT2bBn
|
|
49
49
|
general_manager/utils/noneToZero.py,sha256=KfQtMQnrT6vsYST0K7lv6pVujkDcK3XL8czHYOhgqKQ,539
|
50
50
|
general_manager/utils/pathMapping.py,sha256=nrz5owQg2a69Yig1eCXorR9U0NSw7NmBAk5OkeoHTdA,6842
|
51
51
|
general_manager/utils/testing.py,sha256=IdVvrgLuYIvHRgdSj_j9mC-damQ-2ivSJ7Ngguez5vo,9366
|
52
|
-
generalmanager-0.10.
|
53
|
-
generalmanager-0.10.
|
54
|
-
generalmanager-0.10.
|
55
|
-
generalmanager-0.10.
|
56
|
-
generalmanager-0.10.
|
52
|
+
generalmanager-0.10.2.dist-info/licenses/LICENSE,sha256=YGFm0ieb4KpkMRRt2qnWue6uFh0cUMtobwEBkHwajhc,1450
|
53
|
+
generalmanager-0.10.2.dist-info/METADATA,sha256=HRmeeeiPsxm_UGNOm_-MfW7m94hKL4IIxkM_5_8oGAA,6206
|
54
|
+
generalmanager-0.10.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
55
|
+
generalmanager-0.10.2.dist-info/top_level.txt,sha256=sTDtExP9ga-YP3h3h42yivUY-A2Q23C2nw6LNKOho4I,16
|
56
|
+
generalmanager-0.10.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|