diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-06 02:32:59 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-06 02:45:26 +1100 |
| commit | 559902e0211a06b349c4c2f50b0882a8d314f8b7 (patch) | |
| tree | ecdfcb0983454044ecb28ca8f8f4d781b1124047 /backend/histplorer.py | |
| parent | 442c0bbffc5c372c7ec3510914968f75ab6e4a4f (diff) | |
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.
Diffstat (limited to 'backend/histplorer.py')
| -rwxr-xr-x | backend/histplorer.py | 4 |
1 files changed, 3 insertions, 1 deletions
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() |
