We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd805ba commit 106d496Copy full SHA for 106d496
pydatalab/src/pydatalab/models/__init__.py
@@ -26,8 +26,13 @@
26
"ITEM_MODELS",
27
)
28
29
-Sample.model_rebuild()
30
-StartingMaterial.model_rebuild()
31
-Cell.model_rebuild()
32
-Equipment.model_rebuild()
33
-Collection.model_rebuild()
+MODELS_WITH_CIRCULAR_REFS = [
+ *ITEM_MODELS.values(),
+ Collection,
+]
+
34
+for model in MODELS_WITH_CIRCULAR_REFS:
35
+ try:
36
+ model.model_rebuild()
37
+ except Exception as e:
38
+ print(f"Warning: Failed to rebuild {model.__name__}: {e}")
0 commit comments