mirror of https://gitlab.com/pamhyr/pamhyr2
Model: Tools: Minor change.
parent
37963b7b21
commit
2916afb974
|
|
@ -202,6 +202,24 @@ class SQLSubModel(PamhyrID):
|
||||||
self._owner_scenario = self._status.scenario_id
|
self._owner_scenario = self._status.scenario_id
|
||||||
self._status.modified()
|
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):
|
def is_deleted(self):
|
||||||
"""This object is deleted?
|
"""This object is deleted?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue