From 2053d5f1c1b171cf58b9ca2e3637a4c6bcb8ff3e Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 20 Jan 2020 06:21:07 -0600 Subject: [PATCH] Quote repr --- app/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 17fd50c..6af795d 100644 --- a/app/models.py +++ b/app/models.py @@ -119,4 +119,7 @@ class Quote(db.Model): section_id = db.Column(db.Integer, db.ForeignKey('section.id')) # The section this quote belongs to. speaker = db.Column(db.String(32)) # The name of a character text = db.Column(db.String(512)) # The content of the Quote. Usually a sentence, sometimes more. - section_index = db.Column(db.Integer) # The index of this quote in the section \ No newline at end of file + section_index = db.Column(db.Integer) # The index of this quote in the section + + def __repr__(self): + return f"Quote(speaker='{self.speaker}' text={self.text[:50]}{'...' if len(self.text) > 51 else ''})" \ No newline at end of file