aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/base/data_set.py4
-rw-r--r--wqflask/base/trait.py10
-rw-r--r--wqflask/wqflask/model.py6
-rw-r--r--wqflask/wqflask/user_manager.py2
-rw-r--r--wqflask/wqflask/user_session.py2
5 files changed, 12 insertions, 12 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 8151a29d..39a8a2ed 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -1044,9 +1044,9 @@ class MrnaAssayDataSet(DataSet):
# XZ, 12/08/2008: description
# XZ, 06/05/2009: Rob asked to add probe target description
- description_string = unicode(
+ description_string = str(
str(this_trait.description).strip(codecs.BOM_UTF8), 'utf-8')
- target_string = unicode(
+ target_string = str(
str(this_trait.probe_target_description).strip(codecs.BOM_UTF8), 'utf-8')
if len(description_string) > 1 and description_string != 'None':
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index a19b66f7..09c41fa7 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -490,9 +490,9 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
else:
trait.description_display = ""
- trait.abbreviation = unicode(str(trait.abbreviation).strip(codecs.BOM_UTF8), 'utf-8', errors="replace")
- trait.description_display = unicode(str(trait.description_display).strip(codecs.BOM_UTF8), 'utf-8', errors="replace")
- trait.authors = unicode(str(trait.authors).strip(codecs.BOM_UTF8), 'utf-8', errors="replace")
+ trait.abbreviation = str(str(trait.abbreviation).strip(codecs.BOM_UTF8), 'utf-8', errors="replace")
+ trait.description_display = str(str(trait.description_display).strip(codecs.BOM_UTF8), 'utf-8', errors="replace")
+ trait.authors = str(str(trait.authors).strip(codecs.BOM_UTF8), 'utf-8', errors="replace")
if not trait.year.isdigit():
trait.pubmed_text = "N/A"
@@ -503,8 +503,8 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
trait.pubmed_link = webqtlConfig.PUBMEDLINK_URL % trait.pubmed_id
if dataset.type == 'ProbeSet' and dataset.group:
- description_string = unicode(str(trait.description).strip(codecs.BOM_UTF8), 'utf-8')
- target_string = unicode(str(trait.probe_target_description).strip(codecs.BOM_UTF8), 'utf-8')
+ description_string = str(str(trait.description).strip(codecs.BOM_UTF8), 'utf-8')
+ target_string = str(str(trait.probe_target_description).strip(codecs.BOM_UTF8), 'utf-8')
if len(description_string) > 1 and description_string != 'None':
description_display = description_string
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 38117a8e..a135761c 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -18,7 +18,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 +120,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 +138,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
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index 56d1c084..3c41e2b8 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -252,7 +252,7 @@ class UserSession(object):
def add_collection(self, collection_name, traits):
"""Add collection into ElasticSearch"""
- collection_dict = {'id': unicode(uuid.uuid4()),
+ collection_dict = {'id': str(uuid.uuid4()),
'name': collection_name,
'created_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),
'changed_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),
diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py
index 3aa2c151..71c31c57 100644
--- a/wqflask/wqflask/user_session.py
+++ b/wqflask/wqflask/user_session.py
@@ -184,7 +184,7 @@ class UserSession(object):
def add_collection(self, collection_name, traits):
"""Add collection into Redis"""
- collection_dict = {'id': unicode(uuid.uuid4()),
+ collection_dict = {'id': str(uuid.uuid4()),
'name': collection_name,
'created_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),
'changed_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),