MCPcopy Create free account
hub / github.com/StarKhan6368/threaddit / SavedPosts

Class SavedPosts

backend/threaddit/posts/models.py:104–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103
104class SavedPosts(db.Model):
105 __tablename__ = "saved"
106 id = db.Column(db.Integer, primary_key=True)
107 user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
108 post_id = db.Column(db.Integer, db.ForeignKey("posts.id"))
109 created_at = db.Column(db.DateTime(timezone=True), nullable=False, default=db.func.now())
110 user = db.relationship("User", back_populates="saved_post")
111 post = db.relationship("Posts", back_populates="saved_post")
112
113 def __init__(self, user_id, post_id):
114 self.user_id = user_id
115 self.post_id = post_id
116
117
118class PostInfo(db.Model):

Callers 1

new_savedFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected