Created
November 27, 2014 05:08
-
-
Save Andygmb/32e2380212fe6af9672e 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
class Parent(Base): | |
__tablename__ = 'parent' | |
id = Column(Integer, primary_key=True) | |
children = relationship("Child0"), relationship("Child1"), relationship("Child2") | |
class Child0(Base): | |
__tablename__ = 'child' | |
id = Column(Integer, primary_key=True) | |
parent_id = Column(Integer, ForeignKey('parent.id')) | |
class Child1(Base): | |
__tablename__ = 'child' | |
id = Column(Integer, primary_key=True) | |
parent_id = Column(Integer, ForeignKey('parent.id')) | |
class Child2(Base): | |
__tablename__ = 'child' | |
id = Column(Integer, primary_key=True) | |
parent_id = Column(Integer, ForeignKey('parent.id')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment