Commit b9de34c3 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

snf_django: Impose ordering on operator parsing

Turn the dict of operators to a list to make sure a certain ordering is
preserved.
parent 98cc2f3e
......@@ -95,17 +95,17 @@ def parse_filters(filter_by):
exclude_dict[key] = parse_bool(val, strict=False)
return
OP_MAP = {
">=": "__gte",
"=>": "__gte",
">": "__gt",
"<=": "__lte",
"=<": "__lte",
"<": "__lt",
"=": "",
}
for op, new_op in OP_MAP.items():
OP_MAP = [
(">=", "__gte"),
("=>", "__gte"),
(">", "__gt"),
("<=", "__lte"),
("=<", "__lte"),
("<", "__lt"),
("=", ""),
]
for op, new_op in OP_MAP:
if op in query:
key, val = query.split(op)
filter_dict[key + new_op] = parse_bool(val, strict=False)
......
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