diff options
author | zsloan | 2018-08-14 20:16:32 +0000 |
---|---|---|
committer | zsloan | 2018-08-14 20:16:32 +0000 |
commit | 838362c116b02c090dadeb76cda27e9902a6626a (patch) | |
tree | a6be104cc73e3bc9e271f9b5ca854dd32f3b810d /wqflask/wqflask/model.py | |
parent | 0bead53661ea701ffd9f9d565e4d2ecbbed81a8e (diff) | |
parent | 85defabb17ecdef1c7b8e92fa2e06b44d1e9ca49 (diff) | |
download | genenetwork2-838362c116b02c090dadeb76cda27e9902a6626a.tar.gz |
Merge branch 'testing' of https://github.com/genenetwork/genenetwork2 into production
Diffstat (limited to 'wqflask/wqflask/model.py')
-rw-r--r-- | wqflask/wqflask/model.py | 33 |
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 |