aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/model.py
diff options
context:
space:
mode:
authorSam2013-05-23 00:22:54 +0000
committerSam2013-05-23 00:22:54 +0000
commit7eb9f5d12389df0ef7440a82df0be9bd1119847e (patch)
tree3e81009fa50e1de0bdb10064695cb6179eb94be6 /wqflask/wqflask/model.py
parent66e8d76ea34b6784a451abe3223eb13107d4307f (diff)
downloadgenenetwork2-7eb9f5d12389df0ef7440a82df0be9bd1119847e.tar.gz
Lots of changes around users
Diffstat (limited to 'wqflask/wqflask/model.py')
-rw-r--r--wqflask/wqflask/model.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 9f9267d9..296f1f0d 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -8,6 +8,30 @@ from wqflask import app
# Create database connection object
db = SQLAlchemy(app)
+# Is this right? -Sam
+#from sqlalchemy.ext.declarative import declarative_base
+#Base = declarative_base()
+
+#@classmethod
+#def get(cls, key):
+# """Convenience get method using the primary key
+#
+# If record doesn't exist, returns None
+#
+# Allows the following: User.get('121')
+#
+# """
+# print("in get cls is:", cls)
+# print(" key is {} : {}".format(type(key), key))
+# query = db.Model.query(cls)
+# print("query is: ", query)
+# record = query.get(key)
+# return record
+#
+#
+#print("db.Model is:", vars(db.Model))
+#db.Model.get = get
+
# Define models
roles_users = db.Table('roles_users',
db.Column('user_id', db.Integer(), db.ForeignKey('user.id')),
@@ -38,5 +62,7 @@ class User(db.Model, UserMixin):
user_datastore = SQLAlchemyUserDatastore(db, User, Role)
security = Security(app, user_datastore)
-
db.metadata.create_all(db.engine)
+
+
+