mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Ensure query columns are included too, ref #1503
This commit is contained in:
parent
c9e3cfecc8
commit
1c13e1af06
2 changed files with 11 additions and 2 deletions
|
|
@ -915,6 +915,14 @@ class TableView(RowTableShared):
|
||||||
links.extend(extra_links)
|
links.extend(extra_links)
|
||||||
return links
|
return links
|
||||||
|
|
||||||
|
# filter_columns combine the columns we know are available
|
||||||
|
# in the table with any additional columns (such as rowid)
|
||||||
|
# which are available in the query
|
||||||
|
filter_columns = list(columns) + [
|
||||||
|
table_column
|
||||||
|
for table_column in table_columns
|
||||||
|
if table_column not in columns
|
||||||
|
]
|
||||||
return {
|
return {
|
||||||
"table_actions": table_actions,
|
"table_actions": table_actions,
|
||||||
"supports_search": bool(fts_table),
|
"supports_search": bool(fts_table),
|
||||||
|
|
@ -922,7 +930,7 @@ class TableView(RowTableShared):
|
||||||
"use_rowid": use_rowid,
|
"use_rowid": use_rowid,
|
||||||
"filters": filters,
|
"filters": filters,
|
||||||
"display_columns": display_columns,
|
"display_columns": display_columns,
|
||||||
"filter_columns": table_columns,
|
"filter_columns": filter_columns,
|
||||||
"display_rows": display_rows,
|
"display_rows": display_rows,
|
||||||
"facets_timed_out": facets_timed_out,
|
"facets_timed_out": facets_timed_out,
|
||||||
"sorted_facet_results": sorted(
|
"sorted_facet_results": sorted(
|
||||||
|
|
|
||||||
|
|
@ -936,10 +936,11 @@ def test_table_html_filter_form_still_shows_nocol_columns(app_client):
|
||||||
"pk1",
|
"pk1",
|
||||||
"pk2",
|
"pk2",
|
||||||
"content",
|
"content",
|
||||||
"sortable",
|
|
||||||
"sortable_with_nulls",
|
"sortable_with_nulls",
|
||||||
"sortable_with_nulls_2",
|
"sortable_with_nulls_2",
|
||||||
"text",
|
"text",
|
||||||
|
# Moved to the end because it is no longer returned by the query:
|
||||||
|
"sortable",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue