From 6094adf091b60fae36a1ef1b413efafbd7b82810 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 17 Nov 2024 10:07:15 -0500 Subject: [PATCH] Add table name to each generic filter type; remove list() from hastag --- gramps/gen/filters/_genericfilter.py | 17 +++++++++++++++++ gramps/gen/filters/rules/_hastagbase.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gramps/gen/filters/_genericfilter.py b/gramps/gen/filters/_genericfilter.py index be9bb1240b..0d4f9442df 100644 --- a/gramps/gen/filters/_genericfilter.py +++ b/gramps/gen/filters/_genericfilter.py @@ -58,6 +58,7 @@ class GenericFilter: """Filter class that consists of several rules.""" logical_functions = ["and", "or", "one"] + table = "person" def __init__(self, source=None): if source: @@ -360,6 +361,8 @@ def get_raw_data(self, db, handle): class GenericFamilyFilter(GenericFilter): + tables = "family" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -380,6 +383,8 @@ def get_raw_data(self, db, handle): class GenericEventFilter(GenericFilter): + table = "event" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -400,6 +405,8 @@ def get_raw_data(self, db, handle): class GenericSourceFilter(GenericFilter): + table = "source" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -420,6 +427,8 @@ def get_raw_data(self, db, handle): class GenericCitationFilter(GenericFilter): + table = "citation" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -443,6 +452,8 @@ def get_raw_data(self, db, handle): class GenericPlaceFilter(GenericFilter): + table = "place" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -466,6 +477,8 @@ def get_raw_data(self, db, handle): class GenericMediaFilter(GenericFilter): + table = "media" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -486,6 +499,8 @@ def get_raw_data(self, db, handle): class GenericRepoFilter(GenericFilter): + table = "repository" + def __init__(self, source=None): GenericFilter.__init__(self, source) @@ -506,6 +521,8 @@ def get_raw_data(self, db, handle): class GenericNoteFilter(GenericFilter): + table = "note" + def __init__(self, source=None): GenericFilter.__init__(self, source) diff --git a/gramps/gen/filters/rules/_hastagbase.py b/gramps/gen/filters/rules/_hastagbase.py index edc9fbaeeb..ada365691b 100644 --- a/gramps/gen/filters/rules/_hastagbase.py +++ b/gramps/gen/filters/rules/_hastagbase.py @@ -66,7 +66,7 @@ def prepare(self, db, user): ["$.handle"], ("$.tag_list", "LIKE", f'%"{self.tag_handle}"%'), ) - self.map = set([row["handle"] for row in list(results)]) + self.map = set([row["handle"] for row in results]) else: self.map = set()