This commit is contained in:
Aevann1 2021-09-17 14:36:39 +02:00
parent 7887014474
commit 11c1bbd203
11 changed files with 55 additions and 116 deletions

View file

@ -12,7 +12,7 @@ class Flag(Base, Stndrd):
user_id = Column(Integer, ForeignKey("users.id"))
reason = Column(String(100))
user = relationship("User", lazy = "joined", primaryjoin = "Flag.user_id == User.id", uselist = False)
user = relationship("User", lazy = "joined", primaryjoin = "Flag.user_id == User.id", uselist = False, viewonly=True)
def __repr__(self):
@ -28,7 +28,7 @@ class CommentFlag(Base, Stndrd):
comment_id = Column(Integer, ForeignKey("comments.id"))
reason = Column(String(100))
user = relationship("User", lazy = "joined", primaryjoin = "CommentFlag.user_id == User.id", uselist = False)
user = relationship("User", lazy = "joined", primaryjoin = "CommentFlag.user_id == User.id", uselist = False, viewonly=True)
def __repr__(self):