diff options
author | Zachary Sloan | 2013-06-13 22:45:01 +0000 |
---|---|---|
committer | Zachary Sloan | 2013-06-13 22:45:01 +0000 |
commit | 78998b9400bba9ecc9fdd5e50eef1405bb3625c1 (patch) | |
tree | 88da507baa1ccda96165a908257d891204259d3b /wqflask/secure_server.py | |
parent | aac1dd2f9c5b216b24c6e35676ba5d50f9d5d3c2 (diff) | |
parent | 0e633460f37cb9b7c23805c4c31b1044e0704d1b (diff) | |
download | genenetwork2-78998b9400bba9ecc9fdd5e50eef1405bb3625c1.tar.gz |
Merge /home/sam/gene into flask
Conflicts:
wqflask/wqflask/templates/index_page.html
Merging the code on Sam's branch onto my own
Diffstat (limited to 'wqflask/secure_server.py')
-rw-r--r-- | wqflask/secure_server.py | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/wqflask/secure_server.py b/wqflask/secure_server.py index 5448dbeb..3487f35b 100644 --- a/wqflask/secure_server.py +++ b/wqflask/secure_server.py @@ -3,42 +3,14 @@ from __future__ import print_function, division, absolute_import from wqflask import app from flask import Flask, render_template -from flask.ext.sqlalchemy import SQLAlchemy -from flask.ext.security import Security, SQLAlchemyUserDatastore, UserMixin, RoleMixin -# Create database connection object -db = SQLAlchemy(app) +# Setup mail +from flask.ext.mail import Mail +mail = Mail(app) -# Define models -roles_users = db.Table('roles_users', - db.Column('user_id', db.Integer(), db.ForeignKey('user.id')), - db.Column('role_id', db.Integer(), db.ForeignKey('role.id'))) -class Role(db.Model, RoleMixin): - id = db.Column(db.Integer(), primary_key=True) - name = db.Column(db.String(80), unique=True) - description = db.Column(db.String(255)) - -class User(db.Model, UserMixin): - id = db.Column(db.Integer(), primary_key=True) - email = db.Column(db.String(255), unique=True) - password = db.Column(db.String(255)) - active = db.Column(db.Boolean()) - confirmed_at = db.Column(db.DateTime()) - - last_login_at = db.Column(db.DateTime()) - current_login_at = db.Column(db.DateTime()) - last_login_ip_= db.Column(db.String(39)) - current_login_ip = db.Column(db.String(39)) - login_count = db.Column(db.Integer()) - - roles = db.relationship('Role', secondary=roles_users, - backref=db.backref('users', lazy='dynamic')) - -# Setup Flask-Security -user_datastore = SQLAlchemyUserDatastore(db, User, Role) -security = Security(app, user_datastore) +from wqflask.model import * # Create a user to test with ##@app.before_first_request |