home · contact · privacy
Refactor from_table_row methods of core DB models.
[plomtask] / plomtask / conditions.py
index 27ab62cf303084f4ae62add99ac4f6d39616d4f0..9fab77fc118d81bb650116ec307150fc390532ba 100644 (file)
@@ -22,13 +22,16 @@ class Condition(BaseModel):
     def from_table_row(cls, db_conn: DatabaseConnection,
                        row: Row) -> Condition:
         """Build condition from row, including VersionedAttributes."""
-        condition = cls(row[0], row[1])
+        condition = super().from_table_row(db_conn, row)
+        assert isinstance(condition, Condition)
         for title_row in db_conn.exec('SELECT * FROM condition_titles '
                                       'WHERE parent_id = ?', (row[0],)):
-            condition.title.history[title_row[1]] = title_row[2]
+            condition.title.history[title_row[1]]\
+                    = title_row[2]  # pylint: disable=no-member
         for desc_row in db_conn.exec('SELECT * FROM condition_descriptions '
                                      'WHERE parent_id = ?', (row[0],)):
-            condition.description.history[desc_row[1]] = desc_row[2]
+            condition.description.history[desc_row[1]]\
+                    = desc_row[2]  # pylint: disable=no-member
         return condition
 
     @classmethod