aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/db_tools.py
diff options
context:
space:
mode:
authorArthur Centeno2021-04-09 20:38:21 +0000
committerArthur Centeno2021-04-09 20:38:21 +0000
commite2b04a322f26670782fe7f7c39bcebc508fdabdd (patch)
treea51c32bae4d544cc0beea19f455ccc52f0544a4c /wqflask/utility/db_tools.py
parent187cd40bd3273b50d2813bfccf98bfadbb8c14ff (diff)
parentef51e08753defdfc7f3e67f8788cd1362d2cf631 (diff)
downloadgenenetwork2-e2b04a322f26670782fe7f7c39bcebc508fdabdd.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into acenteno
Diffstat (limited to 'wqflask/utility/db_tools.py')
-rw-r--r--wqflask/utility/db_tools.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/wqflask/utility/db_tools.py b/wqflask/utility/db_tools.py
index 4034f39c..6e19778f 100644
--- a/wqflask/utility/db_tools.py
+++ b/wqflask/utility/db_tools.py
@@ -1,6 +1,5 @@
-from __future__ import absolute_import, print_function, division
+from MySQLdb import escape_string as escape_
-from MySQLdb import escape_string as escape
def create_in_clause(items):
"""Create an in clause for mysql"""
@@ -8,8 +7,11 @@ def create_in_clause(items):
in_clause = '( {} )'.format(in_clause)
return in_clause
+
def mescape(*items):
"""Multiple escape"""
- escaped = [escape(str(item)) for item in items]
- #print("escaped is:", escaped)
- return escaped
+ return [escape_(str(item)).decode('utf8') for item in items]
+
+
+def escape(string_):
+ return escape_(string_).decode('utf8')