From 71e5dcf4143bd98e89f124d4f31f25827cf92192 Mon Sep 17 00:00:00 2001 From: Unrud Date: Tue, 29 Aug 2017 20:08:31 +0200 Subject: [PATCH] Add support for test property in CARDDAV:filter --- radicale/xmlutils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 7c5c205..08dc5b4 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -1203,6 +1203,12 @@ def report(base_prefix, path, xml_request, collection): for child in filter_: if child.tag != _tag("CR", "prop-filter"): raise ValueError("Unexpected %r in filter" % child.tag) + test = filter_.get("test", "anyof") + if test == "anyof": + return any(_prop_match(item.item, f, "CR") for f in filter_) + if test == "allof": + return all(_prop_match(item.item, f, "CR") for f in filter_) + raise ValueError("Unsupported filter test: %r" % test) return all(_prop_match(item.item, f, "CR") for f in filter_) raise ValueError("unsupported filter %r for %r" % (filter_.tag, tag))