aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/db_tools.py
diff options
context:
space:
mode:
authorArthur Centeno2021-10-25 21:04:23 +0000
committerArthur Centeno2021-10-25 21:04:23 +0000
commit499a80f138030c4de1629c043c8f9401a99894ea (patch)
tree449dcae965d13f966fb6d52625fbc86661c8c6a0 /wqflask/utility/db_tools.py
parent6151faa9ea67af4bf4ea95fb681a9dc4319474b6 (diff)
parent700802303e5e8221a9d591ba985d6607aa61e1ce (diff)
downloadgenenetwork2-499a80f138030c4de1629c043c8f9401a99894ea.tar.gz
Merge 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')