From 559902e0211a06b349c4c2f50b0882a8d314f8b7 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Fri, 6 Jan 2023 02:32:59 +1100 Subject: Jump to and highlight search results Use a 'searchTarget' prop of Timeline to trigger jumping to a search result. Make TimeLine prioritise search result in layout. When querying for events in App, check for a search target, and use incl= to retrieve it. On server, for the incl= query param, don't include the event if outside specified range. --- backend/histplorer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'backend/histplorer.py') diff --git a/backend/histplorer.py b/backend/histplorer.py index c20116e..988b69d 100755 --- a/backend/histplorer.py +++ b/backend/histplorer.py @@ -249,7 +249,9 @@ def lookupEvents(start: HistDate | None, end: HistDate | None, scale: int, ctg: incl = None # Get any additional inclusion if incl is not None: - row = dbCur.execute(query + ' WHERE events.id = ?', (incl,)).fetchone() + constraints.append('events.id = ?') + params.append(incl) + row = dbCur.execute(query + ' WHERE ' + ' AND '.join(constraints), params).fetchone() if row is not None: if len(results) == resultLimit: results.pop() -- cgit v1.2.3