--- a/src/pyams_catalog/query.py Wed Apr 15 14:32:28 2015 +0200
+++ b/src/pyams_catalog/query.py Wed Apr 15 14:32:55 2015 +0200
@@ -38,3 +38,21 @@
query = query[1]
for oid in query:
yield self.intids.queryObject(oid)
+
+
+def or_(source, added):
+ """Combine two queries with 'or'"""
+ if source is None:
+ source = added
+ else:
+ source |= added
+ return source
+
+
+def and_(source, added):
+ """Combine two queries with 'and'"""
+ if source is None:
+ source = added
+ else:
+ source &= added
+ return source