aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/utility/db_tools.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/wqflask/utility/db_tools.py b/wqflask/utility/db_tools.py
index 92bde505..6e19778f 100644
--- a/wqflask/utility/db_tools.py
+++ b/wqflask/utility/db_tools.py
@@ -1,4 +1,5 @@
-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"""
@@ -6,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')