summaryrefslogtreecommitdiff
path: root/common/utils.py
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@gmail.com>2014-12-28 12:24:22 +0000
committerMichaël Ball <michael.ball@gmail.com>2015-11-27 20:02:04 +0000
commit75beec91a8526fbbc0a90134140b9dff6af15c0c (patch)
tree02414e46da3e08000384c40c27b7aab9748de0fe /common/utils.py
parenta2964845e3c03b9cf5f01583f53f7553c7d67caf (diff)
Initial frontend work
Diffstat (limited to 'common/utils.py')
-rw-r--r--common/utils.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/utils.py b/common/utils.py
index 288673e..38ad5ed 100644
--- a/common/utils.py
+++ b/common/utils.py
@@ -12,8 +12,18 @@ def make_where_clause(params, join_operator="AND"):
try:
for (column, operator) in params.items():
- condition_subphrase = " ".join(("%s", operator, ":%s"))
- where_items.append(condition_subphrase % (column, column))
+ condition_subphrase = ""
+
+ if operator == "BETWEEN":
+ condition_subphrase = " ".join(("%s", operator,
+ ":%s1 AND :%s2"))
+
+ where_items.append(condition_subphrase % (column, column,
+ column))
+ else:
+ condition_subphrase = " ".join(("%s", operator, ":%s"))
+
+ where_items.append(condition_subphrase % (column, column))
where_statement = None
if len(where_items) > 1: