model: __str__ not __repr__

This commit is contained in:
codl 2017-09-02 10:44:21 +02:00
parent 9bc92fc1f0
commit dda8537b53
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ class Account(TimestampMixin, RemoteIDMixin):
# backref: posts
# backref: sessions
def __repr__(self):
def __str__(self):
return f"<Account({self.id}, {self.screen_name}, {self.display_name})>"
def post_count(self):
@ -238,7 +238,7 @@ class Post(db.Model, TimestampMixin, RemoteIDMixin):
has_media = db.Column(db.Boolean, server_default='FALSE', nullable=False)
direct = db.Column(db.Boolean, server_default='FALSE', nullable=False)
def __repr__(self):
def __str__(self):
return '<Post ({}, Author: {})>'.format(self.id, self.author_id)