mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Friction: Fix load method in case of multiple reaches.
This commit is contained in:
1 parent
5ab06dbe51
commit
45ee8a9662
7 files changed
+36
-21
No files matched your search
@@ -116,7 +116,7 @@ class PointXYZ(Point, SQLSubModel):
|
||||
sl = self._sl.id if self._sl is not None else -1
|
||||
|
||||
sql = (
|
||||
"INSERT OR REPLACE INTO " +
|
||||
"INSERT INTO " +
|
||||
"geometry_pointXYZ(ind, name, x, y, z, profile, sl) " +
|
||||
"VALUES (" +
|
||||
f"{ind}, '{self._db_format(self._name)}', " +
|
||||
|
||||
@@ -115,9 +115,6 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||
f"WHERE reach = {reach.id}"
|
||||
)
|
||||
|
||||
for _ in table:
|
||||
profiles.append(None)
|
||||
|
||||
for row in table:
|
||||
id = row[0]
|
||||
ind = row[1]
|
||||
@@ -132,7 +129,7 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||
id=id, num=num,
|
||||
name=name, kp=kp,
|
||||
code1=code1, code2=code2,
|
||||
reach=data["parent"],
|
||||
reach=reach,
|
||||
status=status
|
||||
)
|
||||
|
||||
@@ -151,10 +148,6 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||
|
||||
yield ind, new
|
||||
|
||||
# profiles[ind] = new
|
||||
|
||||
# return profiles
|
||||
|
||||
def _db_save(self, execute, data=None):
|
||||
ok = True
|
||||
ind = data["ind"]
|
||||
|
||||
@@ -61,7 +61,7 @@ class Reach(SQLSubModel):
|
||||
|
||||
@classmethod
|
||||
def _db_load(cls, execute, data=None):
|
||||
new = cls(status=data["status"], parent=data["parent"])
|
||||
new = cls(status=data["status"], parent=data["reach"])
|
||||
|
||||
new._profiles = ProfileXYZ._db_load(
|
||||
execute,
|
||||
|
||||
Reference in new issue
Block a user