Skip to content

Commit

Permalink
Add table name to each generic filter type; remove list() from hastag
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Nov 17, 2024
1 parent 03262be commit 6094adf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions gramps/gen/filters/_genericfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion gramps/gen/filters/rules/_hastagbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 6094adf

Please sign in to comment.