simplify handling of SQL lookup code for search_name

Use function classes which can be instantiated directly.
This commit is contained in:
Sarah Hoffmann
2023-12-06 10:37:06 +01:00
parent 8791c6cb69
commit b06f5fddcb
7 changed files with 139 additions and 62 deletions

View File

@@ -563,7 +563,6 @@ class PostcodeSearch(AbstractSearch):
if self.lookups:
assert len(self.lookups) == 1
assert self.lookups[0].lookup_type == 'restrict'
tsearch = conn.t.search_name
sql = sql.where(tsearch.c.place_id == t.c.parent_place_id)\
.where((tsearch.c.name_vector + tsearch.c.nameaddress_vector)