diff options
author | root | 2014-02-19 15:07:02 -0600 |
---|---|---|
committer | root | 2014-02-19 15:07:02 -0600 |
commit | 65abf86206da02c682ca0ca3edcdf26519958cfd (patch) | |
tree | 113d4c2752a20723c3c13bb199b7730c754b5566 /wqflask/maintenance/dataset/utilities.py | |
parent | b91219e4180173a96dd7535e40db8d788a60db77 (diff) | |
download | genenetwork2-65abf86206da02c682ca0ca3edcdf26519958cfd.tar.gz |
Committer: root <root@alexandria.uthsc.edu>
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset/utilities.py')
-rw-r--r-- | wqflask/maintenance/dataset/utilities.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/wqflask/maintenance/dataset/utilities.py b/wqflask/maintenance/dataset/utilities.py index 63a3e84d..e542cb43 100644 --- a/wqflask/maintenance/dataset/utilities.py +++ b/wqflask/maintenance/dataset/utilities.py @@ -41,6 +41,30 @@ def overlap(dic1, dic2): values2.append(value2) return keys, values1, values2 +def to_db_string_null(s): + if s: + s = s.strip() + if len(s) == 0: + return None + elif s == 'x': + return None + else: + return s + else: + return None + +def to_db_string_empty(s): + if s: + s = s.strip() + if len(s) == 0: + return '' + elif s == 'x': + return '' + else: + return s + else: + return '' + def get_config(configfile): config = ConfigParser.ConfigParser() config.read(configfile) |