mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix CSV export hidden form fields, closes #393
This commit is contained in:
parent
8b8ae55e7c
commit
996e8822d2
3 changed files with 14 additions and 11 deletions
|
|
@ -148,10 +148,8 @@
|
|||
{% if expandable_columns %}<label><input type="checkbox" name="_labels" checked> expand labels</label>{% endif %}
|
||||
{% if next_url and config.allow_csv_stream %}<label><input type="checkbox" name="_stream"> stream all rows</label>{% endif %}
|
||||
<input type="submit" value="Export CSV">
|
||||
{% for key, value in url_csv_args.items() %}
|
||||
{% if key != "_labels" %}
|
||||
<input type="hidden" name="{{ key }}" value="{{ value }}">
|
||||
{% endif %}
|
||||
{% for key, value in url_csv_hidden_args %}
|
||||
<input type="hidden" name="{{ key }}" value="{{ value }}">
|
||||
{% endfor %}
|
||||
</p>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -464,7 +464,11 @@ class BaseView(RenderMixin):
|
|||
}),
|
||||
"url_csv": url_csv,
|
||||
"url_csv_path": url_csv_path,
|
||||
"url_csv_args": url_csv_args,
|
||||
"url_csv_hidden_args": [
|
||||
(key, value)
|
||||
for key, value in urllib.parse.parse_qsl(request.query_string)
|
||||
if key not in ("_labels", "_facet", "_size")
|
||||
] + [("_size", "max")],
|
||||
"datasette_version": __version__,
|
||||
"config": self.ds.config_dict(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue