From 75beec91a8526fbbc0a90134140b9dff6af15c0c Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Sun, 28 Dec 2014 12:24:22 +0000 Subject: Initial frontend work --- common/utils.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'common/utils.py') 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: -- cgit v1.2.3