diff --git a/models.py b/models.py index 28e5e25..516aec7 100644 --- a/models.py +++ b/models.py @@ -24,6 +24,13 @@ class StudentTopic(Base): student = relationship('Student', back_populates='topics') topic = relationship('Topic', back_populates='students') + def __repr__(self): + return f'''StudentTopic: + student_id: "{self.student_id}" + topic_id: "{self.topic_id}" + level: "{self.level}" + date: "{self.date}"''' + # --------------------------------------------------------------------------- # Registered students # --------------------------------------------------------------------------- @@ -61,13 +68,14 @@ class Answer(Base): topic = relationship('Topic', back_populates='answers') def __repr__(self): - return '''Question: + return f'''Question: id: "{self.id}" ref: "{self.ref}" grade: "{self.grade}" starttime: "{self.starttime}" finishtime: "{self.finishtime}" - student_id: "{self.student_id}"''' + student_id: "{self.student_id}" + topic_id: "{self.topic_id}"''' # --------------------------------------------------------------------------- # Table with student state @@ -80,5 +88,6 @@ class Topic(Base): students = relationship('StudentTopic', back_populates='topic') answers = relationship('Answer', back_populates='topic') - # def __init__(self, id): - # self.id = id + def __repr__(self): + return f'''Topic: + id: "{self.id}"''' -- libgit2 0.21.2