Skip to content

Commit

Permalink
Fixed a test and implemented show_hide_hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Aug 7, 2023
1 parent a791115 commit ea24c9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datasette/views/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ class QueryContext:
columns: list = field(metadata={"help": "List of column names"})
renderers: dict = field(metadata={"help": "Dictionary of renderer name to URL"})
url_csv: str = field(metadata={"help": "URL for CSV export"})
show_hide_hidden: str = field(
metadata={"help": "Hidden input field for the _show_sql parameter"}
)
metadata: dict = field(metadata={"help": "Metadata about the query/database"})
database_color: Callable = field(
metadata={"help": "Function that returns a color for a given database name"}
Expand Down Expand Up @@ -516,6 +519,7 @@ async def fetch_data_for_csv(request, _next=None):
request=request, format="csv"
) # , extra_qs=url_csv_args)
),
show_hide_hidden=markupsafe.Markup(show_hide_hidden),
metadata=metadata,
database_color=lambda _: "#ff0000",
),
Expand Down
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ async def test_custom_sql(ds_client):
{"content": "RENDER_CELL_ASYNC"},
],
"columns": ["content"],
"ok": True,
"truncated": False,
}

Expand Down

0 comments on commit ea24c9c

Please sign in to comment.