Commit d9bc7203 authored by Jérome Perrin's avatar Jérome Perrin

remove spaces at EOL


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22237 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cefcb394
...@@ -96,7 +96,7 @@ class SimpleQuery(QueryMixin): ...@@ -96,7 +96,7 @@ class SimpleQuery(QueryMixin):
table_alias_list = self.getTableAliasList() table_alias_list = self.getTableAliasList()
if table_alias_list is not None: if table_alias_list is not None:
result[self.getKey()] = table_alias_list result[self.getKey()] = table_alias_list
return result return result
def getSQLKeyList(self): def getSQLKeyList(self):
""" """
...@@ -135,7 +135,7 @@ class SimpleQuery(QueryMixin): ...@@ -135,7 +135,7 @@ class SimpleQuery(QueryMixin):
else: else:
search_key_class = DefaultKey search_key_class = DefaultKey
elif isinstance(value, DateTime): elif isinstance(value, DateTime):
search_key_class = DateTimeKey search_key_class = DateTimeKey
elif isinstance(value, (int, long,)): elif isinstance(value, (int, long,)):
search_key_class = DefaultKey search_key_class = DefaultKey
elif isinstance(value, float): elif isinstance(value, float):
...@@ -182,8 +182,8 @@ class SimpleQuery(QueryMixin): ...@@ -182,8 +182,8 @@ class SimpleQuery(QueryMixin):
search_key_class = None search_key_class = None
where_expression_list = [] where_expression_list = []
select_expression_list = [] select_expression_list = []
sql_expressions = {'where_expression': '1', sql_expressions = {'where_expression': '1',
'select_expression_list': []} 'select_expression_list': []}
# try to get search key type by the key definitions passed # try to get search key type by the key definitions passed
...@@ -215,7 +215,7 @@ class SimpleQuery(QueryMixin): ...@@ -215,7 +215,7 @@ class SimpleQuery(QueryMixin):
and isinstance(value, basestring) \ and isinstance(value, basestring) \
and value.strip() == '': and value.strip() == '':
# explicitly requested not to ignore empty strings # explicitly requested not to ignore empty strings
sql_expressions = {'where_expression': "%s = ''" %key, sql_expressions = {'where_expression': "%s = ''" % key,
'select_expression_list': []} 'select_expression_list': []}
return sql_expressions return sql_expressions
else: else:
...@@ -223,7 +223,7 @@ class SimpleQuery(QueryMixin): ...@@ -223,7 +223,7 @@ class SimpleQuery(QueryMixin):
if value is None: if value is None:
sql_expressions = {'where_expression': "%s is NULL" % (key), sql_expressions = {'where_expression': "%s is NULL" % (key),
'select_expression_list': [],} 'select_expression_list': [],}
return sql_expressions return sql_expressions
# we have a list of values and respective operator defined # we have a list of values and respective operator defined
if isinstance(value, (tuple, list)): if isinstance(value, (tuple, list)):
...@@ -235,7 +235,7 @@ class SimpleQuery(QueryMixin): ...@@ -235,7 +235,7 @@ class SimpleQuery(QueryMixin):
if len(value) > 1: if len(value) > 1:
if search_key_class is None: if search_key_class is None:
# no explicitly defined, try to find by value # no explicitly defined, try to find by value
search_key_class = self._getSearchKeyClassByValue(value[0]) search_key_class = self._getSearchKeyClassByValue(value[0])
search_key_instance = getSearchKeyInstance(search_key_class) search_key_instance = getSearchKeyInstance(search_key_class)
escaped_value_list = [search_key_instance.quoteSQLString(x, format) for x in value] escaped_value_list = [search_key_instance.quoteSQLString(x, format) for x in value]
escaped_value_string = ', '.join(escaped_value_list) escaped_value_string = ', '.join(escaped_value_list)
...@@ -244,12 +244,12 @@ class SimpleQuery(QueryMixin): ...@@ -244,12 +244,12 @@ class SimpleQuery(QueryMixin):
if search_key_class is None: if search_key_class is None:
# no explicitly defined, try to find by value # no explicitly defined, try to find by value
search_key_class = self._getSearchKeyClassByValue(value[0]) search_key_class = self._getSearchKeyClassByValue(value[0])
search_key_instance = getSearchKeyInstance(search_key_class) search_key_instance = getSearchKeyInstance(search_key_class)
where_expression_list.append("%s = %s" where_expression_list.append("%s = %s"
%(key, search_key_instance.quoteSQLString(value[0], format))) %(key, search_key_instance.quoteSQLString(value[0], format)))
else: else:
# empty list # empty list
where_expression_list.append("0") where_expression_list.append("0")
elif operator in ('OR', 'AND',): elif operator in ('OR', 'AND',):
# each of the list elements can be treated as a Key, so # each of the list elements can be treated as a Key, so
# leave SQL generation to Key itself # leave SQL generation to Key itself
...@@ -257,7 +257,7 @@ class SimpleQuery(QueryMixin): ...@@ -257,7 +257,7 @@ class SimpleQuery(QueryMixin):
sql_logical_sub_expressions = [] sql_logical_sub_expressions = []
if search_key_class is None: if search_key_class is None:
# no explicitly defined, try to find by value # no explicitly defined, try to find by value
search_key_class = self._getSearchKeyClassByValue(value[0]) search_key_class = self._getSearchKeyClassByValue(value[0])
for item in value: for item in value:
list_item_sql_expressions = self._asSQLExpression(search_key_class, key, \ list_item_sql_expressions = self._asSQLExpression(search_key_class, key, \
item, format, search_mode, range_value, stat__) item, format, search_mode, range_value, stat__)
...@@ -267,8 +267,8 @@ class SimpleQuery(QueryMixin): ...@@ -267,8 +267,8 @@ class SimpleQuery(QueryMixin):
where_expression_list.append("(%s)" % (where_expression)) where_expression_list.append("(%s)" % (where_expression))
elif len(value) == 1: elif len(value) == 1:
if search_key_class is None: if search_key_class is None:
# no explicitly defined, try to find by value # no explicitly defined, try to find by value
search_key_class = self._getSearchKeyClassByValue(value[0]) search_key_class = self._getSearchKeyClassByValue(value[0])
item_sql_expressions = self._asSQLExpression(search_key_class, key, \ item_sql_expressions = self._asSQLExpression(search_key_class, key, \
value[0], format, search_mode, range_value, stat__) value[0], format, search_mode, range_value, stat__)
where_expression_list.append(item_sql_expressions['where_expression']) where_expression_list.append(item_sql_expressions['where_expression'])
...@@ -291,8 +291,8 @@ class SimpleQuery(QueryMixin): ...@@ -291,8 +291,8 @@ class SimpleQuery(QueryMixin):
if search_key_class is None: if search_key_class is None:
search_key_class = DefaultKey search_key_class = DefaultKey
# use respective search key. # use respective search key.
sql_expressions = self._asSQLExpression(search_key_class, key, sql_expressions = self._asSQLExpression(search_key_class, key,
value, format, search_mode, range_value, stat__) value, format, search_mode, range_value, stat__)
return sql_expressions return sql_expressions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment