aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/model.py
diff options
context:
space:
mode:
authorBonfaceKilz2020-10-27 01:18:38 +0300
committerGitHub2020-10-27 01:18:38 +0300
commit37c391bc62e9080effcf83c6ff0056ab8841b7fb (patch)
tree1e794c5616c25e82869314a2f4e91f64c4d40ea9 /wqflask/wqflask/model.py
parent85896707ef1f9e214b45298f6b5b1a9dc37bc839 (diff)
parentb369489e6c075eee3f58bb33e493c901b052b0a1 (diff)
downloadgenenetwork2-37c391bc62e9080effcf83c6ff0056ab8841b7fb.tar.gz
Merge pull request #422 from BonfaceKilz/build/python3-migration
Build/python3 migration
Diffstat (limited to 'wqflask/wqflask/model.py')
-rw-r--r--wqflask/wqflask/model.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 38117a8e..772f74e4 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -1,5 +1,3 @@
-from __future__ import print_function, division, absolute_import
-
import uuid
import datetime
@@ -18,7 +16,7 @@ from wqflask.database import Base, init_db
class User(Base):
__tablename__ = "user"
- id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
+ id = Column(Unicode(36), primary_key=True, default=lambda: str(uuid.uuid4()))
email_address = Column(Unicode(50), unique=True, nullable=False)
# Todo: Turn on strict mode for Mysql
@@ -120,7 +118,7 @@ class User(Base):
class Login(Base):
__tablename__ = "login"
- id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
+ id = Column(Unicode(36), primary_key=True, default=lambda: str(uuid.uuid4()))
user = Column(Unicode(36), ForeignKey('user.id'))
timestamp = Column(DateTime(), default=lambda: datetime.datetime.utcnow())
ip_address = Column(Unicode(39))
@@ -138,7 +136,7 @@ class Login(Base):
class UserCollection(Base):
__tablename__ = "user_collection"
- id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
+ id = Column(Unicode(36), primary_key=True, default=lambda: str(uuid.uuid4()))
user = Column(Unicode(36), ForeignKey('user.id'))
# I'd prefer this to not have a length, but for the index below it needs one
@@ -168,4 +166,4 @@ def display_collapsible(number):
def user_uuid():
"""Unique cookie for a user"""
- user_uuid = request.cookies.get('user_uuid') \ No newline at end of file
+ user_uuid = request.cookies.get('user_uuid')