Fix for combining ?_search_x and ?_searchmode=raw, closes #1134

0.52.x
Simon Willison 2020-12-09 11:56:44 -08:00
rodzic b09818e8f3
commit e48f7f1bfe
2 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -443,7 +443,9 @@ class TableView(RowTableShared):
fts_table = fts_table or await db.fts_table(table)
fts_pk = special_args.get("_fts_pk", table_metadata.get("fts_pk", "rowid"))
search_args = dict(
pair for pair in special_args.items() if pair[0].startswith("_search")
pair
for pair in special_args.items()
if pair[0].startswith("_search") and pair[0] != "_searchmode"
)
search = ""
search_mode_raw = special_args.get("_searchmode") == "raw"

Wyświetl plik

@ -1035,6 +1035,13 @@ def test_sortable_columns_metadata(app_client):
[2, "terry dog", "sara weasel", "puma"],
],
),
(
# _searchmode=raw combined with _search_COLUMN
"/fixtures/searchable.json?_search_text2=te*&_searchmode=raw",
[
[1, "barry cat", "terry dog", "panther"],
],
),
(
"/fixtures/searchable.json?_search=weasel",
[[2, "terry dog", "sara weasel", "puma"]],