Model: Tools: Minor change.

scenarios
Pierre-Antoine 2025-09-02 16:57:08 +02:00
parent 37963b7b21
commit 2916afb974
1 changed files with 18 additions and 0 deletions

View File

@ -202,6 +202,24 @@ class SQLSubModel(PamhyrID):
self._owner_scenario = self._status.scenario_id
self._status.modified()
def set_owner_scenario_if(self, predicate):
"""Set study status the object owner_scenario to current
scenario if predicate(scenario_id) is true
Args:
predicate: Function predicate on owner_scenario id
Returns:
Nothing
"""
if self._status is None:
return
if predicate(self._owner_scenario):
self._owner_scenario = self._status.scenario_id
self._status.modified()
def is_deleted(self):
"""This object is deleted?