mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
HS: Add to scenarios.
This commit is contained in:
1 parent
9ec21d815d
commit
60ee889794
10 files changed
+296
-165
No files matched your search
@@ -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)}, " +
|
||||
|
||||
Reference in new issue
Block a user