mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pamhyr2: Model: Add data traversal method on each pamhyr object.
This commit is contained in:
1 parent
78e6f7e5a7
commit
090326b75c
17 files changed
+179
-13
No files matched your search
@@ -415,6 +415,16 @@ class BoundaryConditionAdisTS(SQLSubModel):
|
||||
|
||||
return True
|
||||
|
||||
def _data_traversal(self,
|
||||
predicate=lambda obj, data: True,
|
||||
modifier=lambda obj, data: None,
|
||||
data={}):
|
||||
if predicate(self, data):
|
||||
modifier(self, data)
|
||||
|
||||
for d in self._data:
|
||||
d._data_traversal(predicate, modifier, data)
|
||||
|
||||
def __len__(self):
|
||||
return len(self._data)
|
||||
|
||||
|
||||
Reference in new issue
Block a user