Created
August 14, 2018 15:05
-
-
Save sampsonc/b8c72ef05d1e763938b1257b484b7298 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Map vip's to issues | |
parent_child_table = Table('parent_child', Base.metadata, | |
Column('parent_id', Integer, ForeignKey('parent.id')), | |
Column('child_id', Integer, ForeignKey('child.id'))) | |
class Parent(Base): | |
__tablename__ = 'parent' | |
id = Column(Integer, primary_key=True) | |
children = relationship("Child", secondary = parent_child_table) | |
class Child(Base): | |
__tablename__ = 'child' | |
id = Column(Integer, primary_key=True) | |
parents = relationship("Parent", secondary=parent_child_table) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment