datasette/datasette/templates
Simon Willison 3a79ad98ea
Basic CSV export, refs #266
Tables and custom SQL query results can now be exported as CSV.

The easiest way to do this is to use the .csv extension, e.g.

	/test_tables/facet_cities.csv

By default this is served as Content-Type: text/plain so you can see it in
your browser. If you want to download the file (using text/csv and with an
appropriate Content-Disposition: attachment header) you can do so like this:

	/test_tables/facet_cities.csv?_dl=1

We link to the CSV and downloadable CSV URLs from the table and query pages.

The links use ?_size=max and so by default will return 1,000 rows.

Also fixes #303 - table names ending in .json or .csv are now detected and
URLs are generated that look like this instead:

	/test_tables/table%2Fwith%2Fslashes.csv?_format=csv

The ?_format= option is available for everything else too, but we link to the
.csv / .json versions in most cases because they are aesthetically pleasing.
2018-06-14 23:51:23 -07:00
..
500.html Better mechanism for handling errors; 404s for missing table/database 2018-04-13 11:17:22 -07:00
_codemirror.html Canned query support + database/query template refactor 2017-12-05 08:17:02 -08:00
_codemirror_foot.html Canned query support + database/query template refactor 2017-12-05 08:17:02 -08:00
_description_source_license.html metadata.json support for per-table/per-database metadata 2017-12-07 08:47:07 -08:00
_rows_and_columns.html _sort/_next links now use new path_with_replaced_args method 2018-05-16 08:27:24 -07:00
base.html Better mechanism for handling errors; 404s for missing table/database 2018-04-13 11:17:22 -07:00
database.html allow_sql config option to disable custom SQL, closes #284 2018-05-24 22:50:50 -07:00
index.html table_rows => table_rows_count, filtered_table_rows => filtered_table_rows_count 2018-04-08 22:24:24 -07:00
query.html Basic CSV export, refs #266 2018-06-14 23:51:23 -07:00
row.html Only apply responsive table CSS to .rows-and-columns 2018-05-20 10:45:01 -07:00
show_json.html Added /-/metadata /-/plugins /-/inspect, closes #225 2018-04-18 22:25:22 -07:00
table.html Basic CSV export, refs #266 2018-06-14 23:51:23 -07:00