mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Improve User str and repr
This commit is contained in:
parent
e1bb5c7365
commit
c8eae01878
1 changed files with 4 additions and 1 deletions
|
@ -27,7 +27,10 @@ class User(Base):
|
||||||
telegram_id = Column(Integer, unique=True)
|
telegram_id = Column(Integer, unique=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.id} - {self.username}"
|
return self.username
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<User {self.id}: {self.username}>"
|
||||||
|
|
||||||
Base.metadata.create_all(engine)
|
Base.metadata.create_all(engine)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue