autonomous-app 0.2.10__py3-none-any.whl → 0.2.12__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.
- autonomous/__init__.py +1 -1
- autonomous/model/automodel.py +26 -11
- autonomous/model/serializer.py +3 -0
- {autonomous_app-0.2.10.dist-info → autonomous_app-0.2.12.dist-info}/METADATA +1 -1
- {autonomous_app-0.2.10.dist-info → autonomous_app-0.2.12.dist-info}/RECORD +8 -8
- {autonomous_app-0.2.10.dist-info → autonomous_app-0.2.12.dist-info}/LICENSE +0 -0
- {autonomous_app-0.2.10.dist-info → autonomous_app-0.2.12.dist-info}/WHEEL +0 -0
- {autonomous_app-0.2.10.dist-info → autonomous_app-0.2.12.dist-info}/top_level.txt +0 -0
autonomous/__init__.py
CHANGED
autonomous/model/automodel.py
CHANGED
|
@@ -20,11 +20,16 @@ class DelayedModel:
|
|
|
20
20
|
assert model
|
|
21
21
|
assert pk
|
|
22
22
|
module_name, class_name = model.rsplit(".", 1)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
try:
|
|
24
|
+
module = importlib.import_module(module_name)
|
|
25
|
+
except ModuleNotFoundError as e:
|
|
26
|
+
log(e)
|
|
27
|
+
raise DanglingReferenceError(model, pk, None)
|
|
28
|
+
else:
|
|
29
|
+
model = getattr(module, class_name)
|
|
30
|
+
object.__setattr__(self, "_delayed_model", model)
|
|
31
|
+
object.__setattr__(self, "_delayed_pk", pk)
|
|
32
|
+
object.__setattr__(self, "_delayed_obj", None)
|
|
28
33
|
|
|
29
34
|
def _instance(self):
|
|
30
35
|
#### DO NOT TO ANY LOGGING IN THIS METHOD; IT CAUSES INFINITE RECURSION ####
|
|
@@ -137,28 +142,38 @@ class AutoModel(ABC):
|
|
|
137
142
|
super().__setattr__(name, result)
|
|
138
143
|
|
|
139
144
|
elif isinstance(obj, list):
|
|
145
|
+
results = []
|
|
146
|
+
scrubbed = False
|
|
140
147
|
for i, item in enumerate(obj):
|
|
141
148
|
if isinstance(item, DelayedModel):
|
|
142
149
|
try:
|
|
143
150
|
result = item._instance()
|
|
144
151
|
except DanglingReferenceError as e:
|
|
145
152
|
log(e)
|
|
146
|
-
|
|
147
|
-
self.save()
|
|
153
|
+
scrubbed = True
|
|
148
154
|
else:
|
|
149
|
-
|
|
155
|
+
results.append(result)
|
|
156
|
+
if scrubbed:
|
|
157
|
+
super().__setattr__(name, results)
|
|
158
|
+
obj = results
|
|
159
|
+
self.save()
|
|
150
160
|
|
|
151
161
|
elif isinstance(obj, dict):
|
|
162
|
+
results = {}
|
|
163
|
+
scrubbed = False
|
|
152
164
|
for key, item in obj.items():
|
|
153
165
|
if isinstance(item, DelayedModel):
|
|
154
166
|
try:
|
|
155
167
|
result = item._instance()
|
|
156
168
|
except DanglingReferenceError as e:
|
|
157
169
|
log(e)
|
|
158
|
-
|
|
159
|
-
self.save()
|
|
170
|
+
scrubbed = True
|
|
160
171
|
else:
|
|
161
|
-
|
|
172
|
+
results[key] = result
|
|
173
|
+
if scrubbed:
|
|
174
|
+
super().__setattr__(name, results)
|
|
175
|
+
obj = results
|
|
176
|
+
self.save()
|
|
162
177
|
return obj
|
|
163
178
|
|
|
164
179
|
def __str__(self) -> str:
|
autonomous/model/serializer.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: autonomous-app
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.12
|
|
4
4
|
Summary: Containerized application framework built on Flask with additional libraries and tools for rapid development of web applications.
|
|
5
5
|
Author-email: Steven A Moore <samoore@binghamton.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
autonomous/__init__.py,sha256=
|
|
1
|
+
autonomous/__init__.py,sha256=BzYOmRUM9f7I1t1IHSyAmpOQVI0y31idB2XhOMKZOa8,87
|
|
2
2
|
autonomous/cli.py,sha256=z4AaGeWNW_uBLFAHng0J_lfS9v3fXemK1PeT85u4Eo4,42
|
|
3
3
|
autonomous/logger.py,sha256=hDX3gvbcWiGPvA8pfarih3xHS4aHG_NuNkF8PQfq_pM,1844
|
|
4
4
|
autonomous/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -15,9 +15,9 @@ autonomous/errors/__init__.py,sha256=OruWG9IkAF4LN-OAo5c2K9Dnds4oZFJJQHKaXbQaWnA
|
|
|
15
15
|
autonomous/errors/danglingreferenceerror.py,sha256=obfNjpn2vsyK4ak-UuuwFTMVzecs1SaeFPshOvnukS8,275
|
|
16
16
|
autonomous/model/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
17
17
|
autonomous/model/autoattribute.py,sha256=q09cORKC6-LpoZ3Ez-lRkd5kxuSFQrB2nA2f9_8k2c8,588
|
|
18
|
-
autonomous/model/automodel.py,sha256=
|
|
18
|
+
autonomous/model/automodel.py,sha256=Z8iDZB7frSV_lQ09HL-l0ff0_ePEuPwjLzWnpbdCsJw,12391
|
|
19
19
|
autonomous/model/orm.py,sha256=IJrbp15RmBgF61vLsqcS_VdnAnw9736sLW75_xFYE9Y,2521
|
|
20
|
-
autonomous/model/serializer.py,sha256=
|
|
20
|
+
autonomous/model/serializer.py,sha256=0nfmw4-QNP-ozL4IVbgQyfPRF2i0-uG9pQZwgEPYuxU,3026
|
|
21
21
|
autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
autonomous/storage/imagestorage.py,sha256=WOBvnpW3VhvliT2pXtaD_Msh1XEAVxqEBELblsvfdtA,3970
|
|
23
23
|
autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2MPpwE,2286
|
|
@@ -29,8 +29,8 @@ autonomous/storage/version_control/GHVersionControl.py,sha256=VIhVRxe6gJgozFWyhy
|
|
|
29
29
|
autonomous/storage/version_control/__init__.py,sha256=tP0bAWYl1RwBRi62HsIidmgyqHuSlCUqwGuKUKKRugc,117
|
|
30
30
|
autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
|
|
31
31
|
autonomous/tasks/autotask.py,sha256=_WQ8w1LyV2FVJ0Ct0FoF9q1W8ClXfS57-omnBb0LNWE,4910
|
|
32
|
-
autonomous_app-0.2.
|
|
33
|
-
autonomous_app-0.2.
|
|
34
|
-
autonomous_app-0.2.
|
|
35
|
-
autonomous_app-0.2.
|
|
36
|
-
autonomous_app-0.2.
|
|
32
|
+
autonomous_app-0.2.12.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
|
|
33
|
+
autonomous_app-0.2.12.dist-info/METADATA,sha256=u1xqcKoYi57wSBGPC41kUVgQ_bTq9wpcroh8mulvE7w,4229
|
|
34
|
+
autonomous_app-0.2.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
35
|
+
autonomous_app-0.2.12.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
|
|
36
|
+
autonomous_app-0.2.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|