HS: Add to scenarios.

This commit is contained in:
Pierre-Antoine Rouby committed 2024-08-28 16:04:19 +02:00
1 parent 9ec21d815d
commit 60ee889794
10 files changed
+296 -165

No files matched your search

+4 -8
View File
@@ -23,7 +23,6 @@ from Model.Scenario import Scenario
class Stricklers(SQLSubModel):
_id_cnt = 0
_sub_classes = []
def __init__(self, id: int = -1,
@@ -33,9 +32,9 @@ class Stricklers(SQLSubModel):
medium: float = 15.0,
status=None, owner_scenario=-1):
super(Stricklers, self).__init__(
id=id, owner_scenario=owner_scenario
id=id, status=status,
owner_scenario=owner_scenario
)
self._status = status
self._name = name
self._comment = comment
@@ -111,7 +110,6 @@ class Stricklers(SQLSubModel):
"FROM stricklers " +
f"WHERE scenario = {scenario.id} " +
f"AND pamhyr_id NOT IN ({', '.join(map(str, loaded))})"
)
if table is None:
@@ -129,9 +127,7 @@ class Stricklers(SQLSubModel):
owner_scenario = next(it)
new = cls(
id=pid,
name=name,
comment=comment,
id=pid, name=name, comment=comment,
minor=minor, medium=medium,
status=status, owner_scenario=owner_scenario
)
@@ -157,7 +153,7 @@ class Stricklers(SQLSubModel):
"name, comment, minor, medium, scenario) " +
"VALUES (" +
f"{self.pamhyr_id}, " +
f"{self.is_deleted()}, " +
f"{self._db_format(self.is_deleted())}, " +
f"'{self._db_format(self.name)}', " +
f"'{self._db_format(self.comment)}', " +
f"{float(self.minor)}, {float(self.medium)}, " +