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 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 = subtree_copy._parent
311
+ parent = None
312
312
  for node in subtree_copy.dfs_traverse_hierarchy():
313
313
  self.build_model_indexes(node)
314
- setattr(node, FIELD_STATIKK_PARENT_ID, parent.id)
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._is_persisted = True
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: statikk
3
- Version: 0.1.15
3
+ Version: 0.1.17
4
4
  Summary: statikk is a single table application (STA) library for DynamoDb.
5
5
  Home-page: https://github.com/terinia/statikk
6
6
  Author: Balint Biro
@@ -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=ccQ57Xsg1brgbDZMHewPzTuCEvz0vRkEVHCRhvX2m5Q,30502
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=3vDyq_ox6zCGsSw72PcIbOEf4pgs3oJskLhvf--EtMQ,19740
6
+ statikk/models.py,sha256=muPhPOB5Lxh_kOt3LkDWksYc1tSP9sEYX2VsRFgkK9s,19708
7
7
  statikk/typing.py,sha256=laOlOpWOm9_sOj4hhdZnGTUZRiq8760_B9I9B3wBhz8,750
8
- statikk-0.1.15.dist-info/licenses/LICENSE.txt,sha256=uSH_2Hpb2Bigy5_HhBliN2fZbBU64G3ERM5zzhKPUEE,1078
9
- statikk-0.1.15.dist-info/METADATA,sha256=sL1Y0GF7pUk3leDfgyTlhV69F5wnOiCPm5jO3WPLkcg,3183
10
- statikk-0.1.15.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
11
- statikk-0.1.15.dist-info/top_level.txt,sha256=etKmBbjzIlLpSefXoiOfhWGEgvqUEALaFwCjFDBD9YI,8
12
- statikk-0.1.15.dist-info/RECORD,,
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,,