Commit 94509a16 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

BC, LC: Fix SQL export.

Showing with 11 additions and 2 deletions
+11 -2
...@@ -96,7 +96,10 @@ class BoundaryCondition(SQLSubModel): ...@@ -96,7 +96,10 @@ class BoundaryCondition(SQLSubModel):
name = row[1], name = row[1],
status = data['status'] status = data['status']
) )
bc.node = next(filter(lambda n: n.id == row[3], data["nodes"]))
bc.node = None
if row[3] != -1:
bc.node = next(filter(lambda n: n.id == row[3], data["nodes"]))
values = execute( values = execute(
"SELECT ind, data0, data1 FROM boundary_condition_data " + "SELECT ind, data0, data1 FROM boundary_condition_data " +
......
...@@ -53,6 +53,8 @@ class BoundaryConditionList(SQLSubModel): ...@@ -53,6 +53,8 @@ class BoundaryConditionList(SQLSubModel):
return new return new
def _sql_save(self, execute, data = None): def _sql_save(self, execute, data = None):
execute("DELETE FROM boundary_condition")
if data is None: if data is None:
data = {} data = {}
......
...@@ -96,7 +96,9 @@ class LateralContribution(SQLSubModel): ...@@ -96,7 +96,9 @@ class LateralContribution(SQLSubModel):
name = row[1], name = row[1],
status = data['status'] status = data['status']
) )
lc.edge = next(filter(lambda e: e.id == row[3], data["edges"])) lc.edge = None
if row[3] != -1:
lc.edge = next(filter(lambda e: e.id == row[3], data["edges"]))
lc._begin_kp = row[4] lc._begin_kp = row[4]
lc._end_kp = row[5] lc._end_kp = row[5]
......
...@@ -51,6 +51,8 @@ class LateralContributionList(SQLSubModel): ...@@ -51,6 +51,8 @@ class LateralContributionList(SQLSubModel):
return new return new
def _sql_save(self, execute, data = None): def _sql_save(self, execute, data = None):
execute("DELETE FROM lateral_contribution")
if data is None: if data is None:
data = {} data = {}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment