fs
This commit is contained in:
parent
34437357be
commit
2cbe1eac16
3 changed files with 7 additions and 6 deletions
|
@ -28,7 +28,7 @@ class Comment(Base):
|
||||||
__tablename__ = "comments"
|
__tablename__ = "comments"
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
comment_aux = relationship("CommentAux", uselist=False, primaryjoin="Comment.id==CommentAux.id", viewonly=True)
|
comment_aux = relationship("CommentAux", uselist=False, primaryjoin="Comment.id==CommentAux.id")
|
||||||
author_id = Column(Integer, ForeignKey("users.id"))
|
author_id = Column(Integer, ForeignKey("users.id"))
|
||||||
parent_submission = Column(Integer, ForeignKey("submissions.id"))
|
parent_submission = Column(Integer, ForeignKey("submissions.id"))
|
||||||
# this column is foreignkeyed to comment(id) but we can't do that yet as
|
# this column is foreignkeyed to comment(id) but we can't do that yet as
|
||||||
|
@ -54,7 +54,7 @@ class Comment(Base):
|
||||||
|
|
||||||
post = relationship("Submission", viewonly=True)
|
post = relationship("Submission", viewonly=True)
|
||||||
flags = relationship("CommentFlag", lazy="dynamic", viewonly=True)
|
flags = relationship("CommentFlag", lazy="dynamic", viewonly=True)
|
||||||
author = relationship("User", primaryjoin="User.id==Comment.author_id", viewonly=True)
|
author = relationship("User", primaryjoin="User.id==Comment.author_id")
|
||||||
|
|
||||||
upvotes = Column(Integer, default=1)
|
upvotes = Column(Integer, default=1)
|
||||||
downvotes = Column(Integer, default=0)
|
downvotes = Column(Integer, default=0)
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Submission(Base):
|
||||||
__tablename__ = "submissions"
|
__tablename__ = "submissions"
|
||||||
|
|
||||||
id = Column(BigInteger, primary_key=True)
|
id = Column(BigInteger, primary_key=True)
|
||||||
submission_aux = relationship("SubmissionAux", uselist=False, primaryjoin="Submission.id==SubmissionAux.id", viewonly=True)
|
submission_aux = relationship("SubmissionAux", uselist=False, primaryjoin="Submission.id==SubmissionAux.id")
|
||||||
author_id = Column(BigInteger, ForeignKey("users.id"))
|
author_id = Column(BigInteger, ForeignKey("users.id"))
|
||||||
edited_utc = Column(BigInteger, default=0)
|
edited_utc = Column(BigInteger, default=0)
|
||||||
created_utc = Column(BigInteger, default=0)
|
created_utc = Column(BigInteger, default=0)
|
||||||
|
@ -55,7 +55,7 @@ class Submission(Base):
|
||||||
flags = relationship("Flag", lazy="dynamic", viewonly=True)
|
flags = relationship("Flag", lazy="dynamic", viewonly=True)
|
||||||
is_approved = Column(Integer, ForeignKey("users.id"), default=0)
|
is_approved = Column(Integer, ForeignKey("users.id"), default=0)
|
||||||
over_18 = Column(Boolean, default=False)
|
over_18 = Column(Boolean, default=False)
|
||||||
author = relationship("User", primaryjoin="Submission.author_id==User.id", viewonly=True)
|
author = relationship("User", primaryjoin="Submission.author_id==User.id")
|
||||||
is_pinned = Column(Boolean, default=False)
|
is_pinned = Column(Boolean, default=False)
|
||||||
is_bot = Column(Boolean, default=False)
|
is_bot = Column(Boolean, default=False)
|
||||||
|
|
||||||
|
|
|
@ -401,8 +401,9 @@ def api_comment(v):
|
||||||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
|
|
||||||
if v.id == 2424:
|
if v.id == 2424:
|
||||||
g.db.add(CommentVote(user_id=747, comment_id=c.id, vote_type=1))
|
cratvote = CommentVote(user_id=747, comment_id=c.id, vote_type=1)
|
||||||
|
g.db.add(cratvote)
|
||||||
v.coins += 1
|
v.coins += 1
|
||||||
v.truecoins += 1
|
v.truecoins += 1
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue