Update User and Role so they have a proper __repr__ method

This commit is contained in:
Gergely Polonkai 2018-06-29 13:24:54 +02:00
parent e7f891d648
commit 495df6d709
1 changed files with 4 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class User(db.Model, UserMixin):
secondary=users_roles,
backref=db.backref('users', lazy='dynamic'))
def __str__(self):
def __repr__(self):
return f'<User {self.id}({self.username})>'
@ -51,3 +51,6 @@ class Role(db.Model, RoleMixin):
#: A description of the role
description = db.Column(db.UnicodeText)
def __repr__(self):
return f'<Role {self.id}({self.name})>'