X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomtask%2Fconditions.py;h=9fab77fc118d81bb650116ec307150fc390532ba;hb=5195f3f36960b76d1b6530ef1822d0806db221d8;hp=27ab62cf303084f4ae62add99ac4f6d39616d4f0;hpb=c5fab0b28785bb8f3a8e2b8e455fd679cfe83d25;p=plomtask diff --git a/plomtask/conditions.py b/plomtask/conditions.py index 27ab62c..9fab77f 100644 --- a/plomtask/conditions.py +++ b/plomtask/conditions.py @@ -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