Created
September 12, 2013 06:12
-
-
Save need4spd/6533560 to your computer and use it in GitHub Desktop.
models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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