statikk 0.1.15__py3-none-any.whl → 0.1.17__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.
- statikk/engine.py +5 -3
- statikk/models.py +2 -3
- {statikk-0.1.15.dist-info → statikk-0.1.17.dist-info}/METADATA +1 -1
- {statikk-0.1.15.dist-info → statikk-0.1.17.dist-info}/RECORD +7 -7
- {statikk-0.1.15.dist-info → statikk-0.1.17.dist-info}/WHEEL +0 -0
- {statikk-0.1.15.dist-info → statikk-0.1.17.dist-info}/licenses/LICENSE.txt +0 -0
- {statikk-0.1.15.dist-info → statikk-0.1.17.dist-info}/top_level.txt +0 -0
statikk/engine.py
CHANGED
@@ -308,10 +308,11 @@ class Table:
|
|
308
308
|
subtree_copy.set_parent_references(subtree_copy, force_override=True)
|
309
309
|
subtree_copy._parent = new_parent
|
310
310
|
subtree_copy._parent_field_name = field_name
|
311
|
-
parent =
|
311
|
+
parent = None
|
312
312
|
for node in subtree_copy.dfs_traverse_hierarchy():
|
313
313
|
self.build_model_indexes(node)
|
314
|
-
|
314
|
+
if parent:
|
315
|
+
setattr(node, FIELD_STATIKK_PARENT_ID, parent.id)
|
315
316
|
parent = node
|
316
317
|
|
317
318
|
return subtree_copy
|
@@ -431,7 +432,8 @@ class Table:
|
|
431
432
|
|
432
433
|
reconstructed_dict.pop(FIELD_STATIKK_TYPE, None)
|
433
434
|
model = model_class.model_validate(reconstructed_dict)
|
434
|
-
model.
|
435
|
+
for node in model.dfs_traverse_hierarchy():
|
436
|
+
node._is_persisted = True
|
435
437
|
return model
|
436
438
|
|
437
439
|
def scan(
|
statikk/models.py
CHANGED
@@ -211,6 +211,8 @@ class DatabaseModel(BaseModel, TrackingMixin):
|
|
211
211
|
arbitrary_types_allowed = True
|
212
212
|
|
213
213
|
def __eq__(self, other):
|
214
|
+
if other is None:
|
215
|
+
return False
|
214
216
|
return self.id == other.id
|
215
217
|
|
216
218
|
def is_parent_changed(self):
|
@@ -263,9 +265,6 @@ class DatabaseModel(BaseModel, TrackingMixin):
|
|
263
265
|
|
264
266
|
@property
|
265
267
|
def is_persisted(self) -> bool:
|
266
|
-
if self._parent is not None:
|
267
|
-
return self._parent.is_persisted
|
268
|
-
|
269
268
|
return self._is_persisted
|
270
269
|
|
271
270
|
@property
|
@@ -1,12 +1,12 @@
|
|
1
1
|
statikk/__init__.py,sha256=pH5i4Fj1tbXLqLtTVIdoojiplZssQn0nnud8-HXodRE,577
|
2
2
|
statikk/conditions.py,sha256=63FYMR-UUaE-ZJEb_8CU721CQTwhajq39-BbokmKeMA,2166
|
3
|
-
statikk/engine.py,sha256=
|
3
|
+
statikk/engine.py,sha256=Gn_jDNJAeMo9wZYO8JPebWZXdYIVJuw46yMGy3tI9BA,30568
|
4
4
|
statikk/expressions.py,sha256=boAeGxZj2cDsXxoiX3IIEzfX9voSMQngi4-rE_jYeuE,12233
|
5
5
|
statikk/fields.py,sha256=uLGD3xEnz2nqQY6EwG8Dd7pnRMMVP4PU2Z2I-uGNaTA,150
|
6
|
-
statikk/models.py,sha256=
|
6
|
+
statikk/models.py,sha256=muPhPOB5Lxh_kOt3LkDWksYc1tSP9sEYX2VsRFgkK9s,19708
|
7
7
|
statikk/typing.py,sha256=laOlOpWOm9_sOj4hhdZnGTUZRiq8760_B9I9B3wBhz8,750
|
8
|
-
statikk-0.1.
|
9
|
-
statikk-0.1.
|
10
|
-
statikk-0.1.
|
11
|
-
statikk-0.1.
|
12
|
-
statikk-0.1.
|
8
|
+
statikk-0.1.17.dist-info/licenses/LICENSE.txt,sha256=uSH_2Hpb2Bigy5_HhBliN2fZbBU64G3ERM5zzhKPUEE,1078
|
9
|
+
statikk-0.1.17.dist-info/METADATA,sha256=2aKUkSirVK2DyiwZzt7PyKKKAvI9Md1G3T6EaGjWBq0,3183
|
10
|
+
statikk-0.1.17.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
11
|
+
statikk-0.1.17.dist-info/top_level.txt,sha256=etKmBbjzIlLpSefXoiOfhWGEgvqUEALaFwCjFDBD9YI,8
|
12
|
+
statikk-0.1.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|