Skip to content

Instantly share code, notes, and snippets.

@Drvanon
Created June 3, 2013 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drvanon/5700177 to your computer and use it in GitHub Desktop.
Save Drvanon/5700177 to your computer and use it in GitHub Desktop.
from sqlalchemy import All_The_Bullshit_I_Need
class Type(Base):
id = Column(Integer, primary_key=True)
name = Column(String)
class Building(Base):
id = Column(Integer, primary_key=True)
to_id = Column(Integer, ForeignKey('types.id'))
from_id = Column(Integer, ForeignKey('types.id'))
to = relationship("Type")
from = relationship("Type")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment