mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Result: Fix db load profiles list.
This commit is contained in:
1 parent
26d1d63edb
commit
5f5a47679d
1 file changed
+4
-4
@@ -196,7 +196,7 @@ class Profile(SQLSubModel):
|
|||||||
class Reach(SQLSubModel):
|
class Reach(SQLSubModel):
|
||||||
_sub_classes = [Profile]
|
_sub_classes = [Profile]
|
||||||
|
|
||||||
def __init__(self, reach, study):
|
def __init__(self, reach, study, with_init=True):
|
||||||
super(Reach, self).__init__(
|
super(Reach, self).__init__(
|
||||||
id=-1, status=study.status,
|
id=-1, status=study.status,
|
||||||
owner_scenario=study.status.scenario.id
|
owner_scenario=study.status.scenario.id
|
||||||
@@ -204,6 +204,8 @@ class Reach(SQLSubModel):
|
|||||||
|
|
||||||
self._study = study
|
self._study = study
|
||||||
self._reach = reach # Source reach in the study
|
self._reach = reach # Source reach in the study
|
||||||
|
self._profiles = []
|
||||||
|
if with_init:
|
||||||
self._profiles = list(
|
self._profiles = list(
|
||||||
map(
|
map(
|
||||||
lambda p: Profile(p, self._study),
|
lambda p: Profile(p, self._study),
|
||||||
@@ -253,9 +255,7 @@ class Reach(SQLSubModel):
|
|||||||
|
|
||||||
for profile in reach.profiles:
|
for profile in reach.profiles:
|
||||||
data["profile"] = profile
|
data["profile"] = profile
|
||||||
new_reach._profiles.append(
|
new_reach._profiles += Profile._db_load(execute, data)
|
||||||
Profile._db_load(execute, data)
|
|
||||||
)
|
|
||||||
|
|
||||||
return new_reach
|
return new_reach
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user