statikk 0.1.16__py3-none-any.whl → 0.1.18__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
@@ -656,8 +657,11 @@ class Table:
656
657
  children_by_parent_id[parent_id] = []
657
658
  children_by_parent_id[parent_id].append(item)
658
659
 
659
- root_item = [item for item in items if FIELD_STATIKK_PARENT_ID not in item][0]
660
+ root_items = [item for item in items if FIELD_STATIKK_PARENT_ID not in item]
661
+ if not root_items:
662
+ return None
660
663
 
664
+ root_item = root_items[0]
661
665
  processed_root = self._process_item(root_item, items_by_id, children_by_parent_id)
662
666
  return processed_root
663
667
 
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: statikk
3
- Version: 0.1.16
3
+ Version: 0.1.18
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=YkJW2wUxFAIcw0o1r7RF0gwQm-znjjJ-rzBSzXBtCB0,30557
3
+ statikk/engine.py,sha256=Dd0JE572K5V-a4aUu_0KPkF6xxKDIW40t8tuojwlk6w,30651
4
4
  statikk/expressions.py,sha256=boAeGxZj2cDsXxoiX3IIEzfX9voSMQngi4-rE_jYeuE,12233
5
5
  statikk/fields.py,sha256=uLGD3xEnz2nqQY6EwG8Dd7pnRMMVP4PU2Z2I-uGNaTA,150
6
- statikk/models.py,sha256=27s8Rvb8lcQFtaxHEZsKSHebqa1c3GqClUtoE1PJH2I,19657
6
+ statikk/models.py,sha256=muPhPOB5Lxh_kOt3LkDWksYc1tSP9sEYX2VsRFgkK9s,19708
7
7
  statikk/typing.py,sha256=laOlOpWOm9_sOj4hhdZnGTUZRiq8760_B9I9B3wBhz8,750
8
- statikk-0.1.16.dist-info/licenses/LICENSE.txt,sha256=uSH_2Hpb2Bigy5_HhBliN2fZbBU64G3ERM5zzhKPUEE,1078
9
- statikk-0.1.16.dist-info/METADATA,sha256=mrUj-DWF9nBmjzjlLL5ax4Kkx3UahYRhEr4g39WbRpg,3183
10
- statikk-0.1.16.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
11
- statikk-0.1.16.dist-info/top_level.txt,sha256=etKmBbjzIlLpSefXoiOfhWGEgvqUEALaFwCjFDBD9YI,8
12
- statikk-0.1.16.dist-info/RECORD,,
8
+ statikk-0.1.18.dist-info/licenses/LICENSE.txt,sha256=uSH_2Hpb2Bigy5_HhBliN2fZbBU64G3ERM5zzhKPUEE,1078
9
+ statikk-0.1.18.dist-info/METADATA,sha256=n93PRdbXRyGLkzuivDPG4avKtwR22xgE0f-jxrUb7rI,3183
10
+ statikk-0.1.18.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
11
+ statikk-0.1.18.dist-info/top_level.txt,sha256=etKmBbjzIlLpSefXoiOfhWGEgvqUEALaFwCjFDBD9YI,8
12
+ statikk-0.1.18.dist-info/RECORD,,