fddf
This commit is contained in:
parent
c3ce4c8743
commit
254995d1e4
948 changed files with 128 additions and 128 deletions
24
files/classes/userblock.py
Normal file
24
files/classes/userblock.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import relationship
|
||||
from .mix_ins import *
|
||||
from files.__main__ import Base
|
||||
|
||||
class UserBlock(Base, Stndrd, Age_times):
|
||||
|
||||
__tablename__ = "userblocks"
|
||||
id = Column(Integer, primary_key=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"))
|
||||
target_id = Column(Integer, ForeignKey("users.id"))
|
||||
|
||||
user = relationship(
|
||||
"User",
|
||||
innerjoin=True,
|
||||
primaryjoin="User.id==UserBlock.user_id")
|
||||
target = relationship(
|
||||
"User",
|
||||
innerjoin=True,
|
||||
primaryjoin="User.id==UserBlock.target_id")
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
return f"<UserBlock(user={user.username}, target={target.username})>"
|
Loading…
Add table
Add a link
Reference in a new issue