This commit is contained in:
Aevann1 2021-09-19 20:25:40 +02:00
parent a16d56358c
commit c5f8e567bb
10 changed files with 77 additions and 7 deletions

View file

@ -1,6 +1,7 @@
from sqlalchemy import *
from sqlalchemy.orm import relationship
from files.__main__ import Base
from files.helpers.lazy import lazy
class UserBlock(Base):
@ -12,11 +13,11 @@ class UserBlock(Base):
user = relationship("User", innerjoin=True, primaryjoin="User.id==UserBlock.user_id", viewonly=True)
target = relationship("User", innerjoin=True, primaryjoin="User.id==UserBlock.target_id", viewonly=True)
@property
@lazy
def created_date(self):
return time.strftime("%d %b %Y", time.gmtime(self.created_utc))
def __repr__(self):
return f"<UserBlock(user={user.username}, target={target.username})>"
@property
@lazy
def created_date(self):
return time.strftime("%d %b %Y", time.gmtime(self.created_utc))