aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/model.py
diff options
context:
space:
mode:
authorSam2013-08-23 17:38:55 -0500
committerSam2013-08-23 17:38:55 -0500
commitf2e41174a7e2091e7e835b137c6c7e2874feda04 (patch)
treeefb0a2aadd9fb6bf99a801a2a7b8e6141e35edf4 /wqflask/wqflask/model.py
parent2138e6b9d91bd3a109e202b9ad2029a737f374e6 (diff)
downloadgenenetwork2-f2e41174a7e2091e7e835b137c6c7e2874feda04.tar.gz
Finally figured out where to put flask_security into the code
Various registration template changes
Diffstat (limited to 'wqflask/wqflask/model.py')
-rw-r--r--wqflask/wqflask/model.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 5beba9ff..1f873545 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -3,6 +3,9 @@ from __future__ import print_function, division, absolute_import
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.security import Security, SQLAlchemyUserDatastore, UserMixin, RoleMixin
+from flask_security.forms import TextField
+from flask_security.forms import RegisterForm
+
from wqflask import app
# Create database connection object
@@ -46,6 +49,10 @@ 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))
+
+ name = db.Column(db.Unicode(255))
+ organization = db.Column(db.Unicode(255))
+
active = db.Column(db.Boolean())
confirmed_at = db.Column(db.DateTime())
@@ -60,7 +67,12 @@ class User(db.Model, UserMixin):
# Setup Flask-Security
user_datastore = SQLAlchemyUserDatastore(db, User, Role)
-security = Security(app, user_datastore)
+
+class ExtendedRegisterForm(RegisterForm):
+ name = TextField('name')
+ organization = TextField('organization')
+
+security = Security(app, user_datastore, register_form=ExtendedRegisterForm)
db.metadata.create_all(db.engine)