Skip to content
Snippets Groups Projects
Verified Commit df81b88f authored by Timm Fitschen's avatar Timm Fitschen
Browse files

FIX id in [...] filter

parent 29d8e150
Branches
Tags
No related merge requests found
...@@ -144,16 +144,16 @@ class DefaultCaosDBClientDelegate: ...@@ -144,16 +144,16 @@ class DefaultCaosDBClientDelegate:
if filter_type in ["reference", "back_reference"]: if filter_type in ["reference", "back_reference"]:
return self._get_reference_clause(**fil) return self._get_reference_clause(**fil)
if filter_type == "in": if filter_type == "in":
p = fil["p"] p = fil["p"] if fil["p"] == "id" else f'"{fil["p"]}"'
values = fil["v"] values = fil["v"]
components = [f' "{p}" = ' + str(val) for val in values] components = [f' {p} = ' + str(val) for val in values]
return " OR".join(components) return " OR".join(components)
if filter_type == "pov": if filter_type == "pov":
n = "NOT " if fil["negation"] is True else "" n = "NOT " if fil["negation"] is True else ""
p = fil["p"] p = fil["p"] if fil["p"] == "id" else f'"{fil["p"]}"'
o = fil["o"] o = fil["o"]
v = fil["v"] v = fil["v"]
return f' {n}"{p}"{o}"{v}"' return f' {n}{p}{o}"{v}"'
raise NotImplementedError("_get_filter_clause(%s)", fil) raise NotImplementedError("_get_filter_clause(%s)", fil)
def _find(self, record_type, *args, **kwargs): def _find(self, record_type, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment