1
Fork 0
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:
Steffo 2017-03-22 18:00:12 +01:00
parent e1bb5c7365
commit c8eae01878

View file

@ -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)