From dc698782b99615322c3f983ac72df56f3155b91d Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 12 Jan 2016 10:09:51 -0500 Subject: [PATCH] db.select does a recursive compare when multi-values --- gramps/gen/db/base.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gramps/gen/db/base.py b/gramps/gen/db/base.py index 3d4f3a39c..9a467e926 100644 --- a/gramps/gen/db/base.py +++ b/gramps/gen/db/base.py @@ -1915,6 +1915,12 @@ class DbWriteBase(DbReadBase): """ Compare values in a SQL-like way """ + if isinstance(v, (list, tuple)): # join, or multi-values + # If any is true: + for item in v: + if compare(item, op, value): + return True + return False if op == "=": matched = v == value elif op == ">": @@ -1927,8 +1933,6 @@ class DbWriteBase(DbReadBase): matched = v <= value elif op == "IN": matched = v in value - elif op == "NI": - matched = value in v elif op == "IS": matched = v is value elif op == "IS NOT":