Skip to content

Instantly share code, notes, and snippets.

@mattjbarlow
Created January 4, 2014 00:30
Show Gist options
  • Save mattjbarlow/8249606 to your computer and use it in GitHub Desktop.
Save mattjbarlow/8249606 to your computer and use it in GitHub Desktop.
from sqlalchemy import Column, Integer, String
class Animal(Base):
__tablename__ = 'animals'
id = Column(Integer, primary_key=True)
common_name = Column(String)
latin_name = Column(String)
kingdom = Column(String)
def __init__(self, common_name, latin_name, kingdom):
self.common_name = common_name
self.latin_name = latin_name
self.kingdom = kingdom
def __repr__(self):
return "<Animal('%s','%s', '%s')>" % (self.common_name,
self.latin_name, self.kingdom)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment