aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/model.py
diff options
context:
space:
mode:
authoracenteno2020-04-21 17:35:34 -0500
committerGitHub2020-04-21 17:35:34 -0500
commit660589b9c2a507529e8e51ca6ce66ca97ad982c5 (patch)
tree27f63957278581bc2fce2b88744bfe20c8a81558 /wqflask/wqflask/model.py
parentd97fdc18359233f07c1a1c7b83fe7e88eb225043 (diff)
parentf2a3ae13231a7d270a5bb6911c248aa713f1ef91 (diff)
downloadgenenetwork2-660589b9c2a507529e8e51ca6ce66ca97ad982c5.tar.gz
Merge pull request #1 from genenetwork/testing
Updating my testing branch
Diffstat (limited to 'wqflask/wqflask/model.py')
-rw-r--r--wqflask/wqflask/model.py33
1 files changed, 3 insertions, 30 deletions
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 5321e420..38117a8e 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -6,31 +6,16 @@ import datetime
import simplejson as json
from flask import request
-from flask.ext.sqlalchemy import SQLAlchemy
from wqflask import app
import sqlalchemy
-
-from sqlalchemy import (Column, Integer, String, Table, ForeignKey, Unicode, Boolean, DateTime,
+from sqlalchemy import (Column, ForeignKey, Unicode, Boolean, DateTime,
Text, Index)
-from sqlalchemy.orm import relationship, backref
+from sqlalchemy.orm import relationship
from wqflask.database import Base, init_db
-
-
-# Define models
-#roles_users = Table('roles_users',
-# Column('user_id', Integer(), ForeignKey('user.the_id')),
-# Column('role_id', Integer(), ForeignKey('role.the_id')))
-
-#class Role(Base):
-# __tablename__ = "role"
-# id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
-# name = Column(Unicode(80), unique=True, nullable=False)
-# description = Column(Unicode(255))
-
class User(Base):
__tablename__ = "user"
id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
@@ -133,11 +118,6 @@ class User(Base):
except IndexError:
return None
-
- #roles = relationship('Role', secondary=roles_users,
- # backref=backref('users', lazy='dynamic'))
-
-
class Login(Base):
__tablename__ = "login"
id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
@@ -177,22 +157,15 @@ class UserCollection(Base):
except:
return 0
- #@property
- #def display_num_members(self):
- # return display_collapsible(self.num_members)
-
def members_as_set(self):
return set(json.loads(self.members))
-
def display_collapsible(number):
if number:
return number
else:
return ""
-
def user_uuid():
"""Unique cookie for a user"""
- user_uuid = request.cookies.get('user_uuid')
-
+ user_uuid = request.cookies.get('user_uuid') \ No newline at end of file