1from flask.ext.sqlalchemy import SQLAlchemy
2db = SQLAlchemy(app)
3
4class Base(db.Model):
5 __abstract__ = True
6
7 created_on = db.Column(db.DateTime, default=db.func.now())
8 updated_on = db.Column(db.DateTime, default=db.func.now(), onupdate=db.func.now())
9
10
11class User(Base):
12 __tablename__ = 'users'
13 id = db.Column(db.Integer, primary_key = True)
14 email = db.Column(db.String(255), unique = True)
15