I can save and load Datagrid content

This commit is contained in:
2026-01-06 18:46:17 +01:00
parent 2f808ed226
commit 70abf21c14
6 changed files with 47 additions and 18 deletions

View File

@@ -55,13 +55,14 @@ class DbObject:
self._initializing = old_state
def __setattr__(self, name: str, value: str):
if name.startswith("_") or name.startswith("ns") or getattr(self, "_initializing", False):
if name.startswith("_") or name.startswith("ns_") or getattr(self, "_initializing", False):
super().__setattr__(name, value)
return
old_value = getattr(self, name, None)
if old_value == value:
return
if not name.startswith("ne_"):
old_value = getattr(self, name, None)
if old_value == value:
return
super().__setattr__(name, value)
self._save_self()

View File

@@ -144,8 +144,11 @@ class UniqueInstance(BaseInstance):
parent: Optional[BaseInstance] = None,
session: Optional[dict] = None,
_id: Optional[str] = None,
auto_register: bool = True):
auto_register: bool = True,
on_init=None):
super().__init__(parent, session, _id, auto_register)
if on_init is not None:
on_init()
class MultipleInstance(BaseInstance):