Skip to content

Instantly share code, notes, and snippets.

@need4spd
Created September 12, 2013 06:12
Show Gist options
  • Save need4spd/6533560 to your computer and use it in GitHub Desktop.
Save need4spd/6533560 to your computer and use it in GitHub Desktop.
models.py
from sqlalchemy import Column, Integer, String
from database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String(50), unique=True)
email = Column(String(120), unique=True)
description = Column(String(120), unique=False)
def __init__(self, name=None, email=None, description=None):
self.name = name
self.email = email
self.description = description
def __repr__(self):
return '<User %r>' % (self.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment