I am modeling Repositories on GitHub. Each Repo can have a set of forks, of which the Repo will be the parent of.
My partial model file looks like this:
class Repo(Base):
__tablename__ = "repos"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Text, unique=True)
parent_id = db.Column(Integer,db.ForeignKey('repos.id'))
parent = db.relationship("Repo")
I am having trouble wrapping my head around how to properly make this relationship.