Skip to content

Instantly share code, notes, and snippets.

@LordNoteworthy
Last active November 18, 2015 19:52
Show Gist options
  • Save LordNoteworthy/4048d544301590faf25b to your computer and use it in GitHub Desktop.
Save LordNoteworthy/4048d544301590faf25b to your computer and use it in GitHub Desktop.
class Foo (Base):
a = Column(Integer, ForeignKey='sometable.id', primary_key = True)
b = Column(Integer, ForeignKey='other_table.id', primary_key = True)
c = ...
Class Boo (Base):
id = Column(Integer, primary_key = True)
....
// Association table for many to many relationship between A and B
Class A_Link_B(Base):
boo_id = Column(Integer, ForeignKey='Boo.id', primary_key = True)
fod_id = composite of primary keys in Foo table as a FK here
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment