Skip to content

Instantly share code, notes, and snippets.

@thequbit
Created April 8, 2015 13:03
Show Gist options
  • Save thequbit/4ab60a1dc9a73a22e8e2 to your computer and use it in GitHub Desktop.
Save thequbit/4ab60a1dc9a73a22e8e2 to your computer and use it in GitHub Desktop.
class Customers(Base):
__tablename__ = 'customers'
id = Column(Integer, primary_key=True)
name = Column(Unicode)
description = Column(Unicode)
class Accounts(Base):
__tablename__ = 'accounts'
id = Column(Integer, primary_key=True)
customer_id = Column(Integer, ForeignKey('customers.id'))
name = Column(Unicode)
description = Column(Unicode)
class Contacts(Base):
__tablename__ = 'contacts'
id = Column(Integer, primary_key=True)
customer_id = Column(Integer, ForeignKey('customers.id'))
first = Column(Unicode)
last = Column(Unicode)
email = Column(Unicode)
office_phone = Column(Unicode)
mobile_phone = Column(Unicode)
fax = Column(Unicode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment