mirror of https://gitlab.com/pamhyr/pamhyr2
Model, SQL: Some minor change for bug fix in SQL export/load.
parent
8ca1ac8fcf
commit
1b9115ef87
|
|
@ -16,7 +16,7 @@ class BoundaryCondition(SQLSubModel):
|
||||||
self._status = status
|
self._status = status
|
||||||
|
|
||||||
if id == -1:
|
if id == -1:
|
||||||
self.id = type(self)._id_cnt
|
self.id = BoundaryCondition._id_cnt
|
||||||
else:
|
else:
|
||||||
self.id = id
|
self.id = id
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ class BoundaryCondition(SQLSubModel):
|
||||||
self._header = []
|
self._header = []
|
||||||
self._types = [float, float]
|
self._types = [float, float]
|
||||||
|
|
||||||
type(self)._id_cnt = max(type(self)._id_cnt + 1, self.id)
|
BoundaryCondition._id_cnt = max(BoundaryCondition._id_cnt + 1, self.id)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _sql_create(cls, execute):
|
def _sql_create(cls, execute):
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,8 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||||
data = {}
|
data = {}
|
||||||
data["profile"] = self.id
|
data["profile"] = self.id
|
||||||
|
|
||||||
|
execute(f"DELETE FROM geometry_pointXYZ WHERE profile = {self.id}")
|
||||||
|
|
||||||
ind = 0
|
ind = 0
|
||||||
for point in self._points:
|
for point in self._points:
|
||||||
data["ind"] = ind
|
data["ind"] = ind
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class LateralContribution(SQLSubModel):
|
||||||
self._status = status
|
self._status = status
|
||||||
|
|
||||||
if id == -1:
|
if id == -1:
|
||||||
self.id = type(self)._id_cnt
|
self.id = LateralContribution._id_cnt
|
||||||
else:
|
else:
|
||||||
self.id = id
|
self.id = id
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ class LateralContribution(SQLSubModel):
|
||||||
self._header = []
|
self._header = []
|
||||||
self._types = [float, float]
|
self._types = [float, float]
|
||||||
|
|
||||||
type(self)._id_cnt = max(type(self)._id_cnt + 1, self.id)
|
LateralContribution._id_cnt = max(LateralContribution._id_cnt + 1, self.id)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _sql_create(cls, execute):
|
def _sql_create(cls, execute):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue