diff options
author | Zachary Sloan | 2013-07-18 15:06:40 -0500 |
---|---|---|
committer | Zachary Sloan | 2013-07-18 15:06:40 -0500 |
commit | 89c4dc078c6371e4bc56bf8708fc7dca6c49b350 (patch) | |
tree | 2c6fa9e5c78fa3252b52c537a9cb24c2f1437a44 /wqflask/base/trait.py | |
parent | d9065d1b94c3305f06c4ee368d4b0850b3a96e21 (diff) | |
parent | 1a3a456eb7635337a966913f2e2e75c8a89bb92e (diff) | |
download | genenetwork2-89c4dc078c6371e4bc56bf8708fc7dca6c49b350.tar.gz |
Merge branch 'master' of https://github.com/zsloan/genenetwork
Conflicts:
wqflask/base/webqtlConfigLocal.py
wqflask/maintenance/gen_select_dataset.py
wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
Diffstat (limited to 'wqflask/base/trait.py')
-rwxr-xr-x | wqflask/base/trait.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index db76ddea..6648047c 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -320,7 +320,11 @@ class GeneralTrait(object): #XZ: assign SQL query result to trait attributes. for i, field in enumerate(self.dataset.display_fields): print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i])) - setattr(self, field, trait_info[i]) + holder = trait_info[i] + if isinstance(trait_info[i], basestring): + print("is basestring") + holder = unicode(trait_info[i], "utf8") + setattr(self, field, holder) if self.dataset.type == 'Publish': self.confidential = 0 @@ -329,9 +333,9 @@ class GeneralTrait(object): self.homologeneid = None - print("self.geneid is:", self.geneid) - print(" type:", type(self.geneid)) - print("self.dataset.group.name is:", self.dataset.group.name) + #print("self.geneid is:", self.geneid) + #print(" type:", type(self.geneid)) + #print("self.dataset.group.name is:", self.dataset.group.name) if self.dataset.type == 'ProbeSet' and self.dataset.group and self.geneid: #XZ, 05/26/2010: From time to time, this query get error message because some geneid values in database are not number. #XZ: So I have to test if geneid is number before execute the query. |