Commit graph

308 commits

Author SHA1 Message Date
Simon Willison
1baa030eca
Switch to dash encoding for table/database/row-pk in paths
* Dash encoding functions, tests and docs, refs #1439
* dash encoding is now like percent encoding but with dashes
* Use dash-encoding for row PKs and ?_next=, refs #1439
* Use dash encoding for table names, refs #1439
* Use dash encoding for database names, too, refs #1439

See also https://simonwillison.net/2022/Mar/5/dash-encoding/
2022-03-07 07:38:29 -08:00
Simon Willison
23a09b0f6a Remove JSON rel=alternate from some pages, closes #1623 2022-02-02 13:48:52 -08:00
Simon Willison
8d5779acf0 Refactored alternate_url_json mechanism, refs #1620, #1533 2022-02-02 13:32:47 -08:00
Simon Willison
b72b2423c7 rel=alternate JSON for queries and database pages, closes #1620 2022-02-02 13:22:45 -08:00
Simon Willison
3ef47a0896 Link rel=alternate header for tables and rows
Also added Access-Control-Expose-Headers: Link to --cors mode.

Closes #1533

Refs https://github.com/simonw/datasette-notebook/issues/2

LL#	metadata.json.1
2022-02-01 23:49:09 -08:00
Simon Willison
ab7d6a7179 Updated settings help URL to avoid redirect 2022-01-13 16:38:16 -08:00
Simon Willison
3a0f7d6488 Fixed hidden form fields bug #1527 2022-01-13 16:27:21 -08:00
Simon Willison
8c401ee0f0 Fixed remaining code and docs for new block=True default, closes #1579 2021-12-23 11:18:20 -08:00
Simon Willison
ace86566b2 Remove concept of special_args, re-arrange TableView a bit, refs #1518 2021-12-22 12:23:05 -08:00
Simon Willison
4094741c28 Fixed bug with custom templates for writable canned queries, closes #1547 2021-12-19 13:11:57 -08:00
Simon Willison
d0f24f9bbc Clarifying comment
The new filters stuff is a little bit action-at-a-distance
2021-12-17 15:55:06 -08:00
Simon Willison
aa7f0037a4
filters_from_request plugin hook, now used in TableView
- New `filters_from_request` plugin hook, closes #473
- Used it to extract the logic from TableView that handles `_search` and
`_through` and `_where` - refs #1518

Also needed for this plugin work: https://github.com/simonw/datasette-leaflet-freedraw/issues/7
2021-12-17 11:02:14 -08:00
Simon Willison
0663d5525c More comments in TableView.data(), refs #1518 2021-12-16 14:00:29 -08:00
Simon Willison
2c07327d23 Move columns_to_select to TableView class, add lots of comments, refs #1518 2021-12-16 13:43:44 -08:00
Simon Willison
95d0dd7a1c Fix for colliding facet types bug, closes #625
Refs #830
2021-12-16 12:12:04 -08:00
Simon Willison
992496f261 ?_nosuggest=1 parameter for table views, closes #1557 2021-12-16 11:24:54 -08:00
Simon Willison
eb53837d2a Always show count of distinct facet values, closes #1556
Refs #1423
2021-12-15 09:58:01 -08:00
Simon Willison
a6ff123de5 keep_blank_values=True when parsing query_string, closes #1551
Refs #1518
2021-12-12 12:01:51 -08:00
Simon Willison
a37ee74891 Correct link to _ prefix on row page, closes #1525 2021-11-29 22:34:31 -08:00
Simon Willison
06762776f7 Fix for incorrect hidden for fields for _columns, refs #1527 2021-11-29 19:04:35 -08:00
Simon Willison
08947fa764 Fix more broken base_url links
Refs #1519, #838
2021-11-20 11:03:08 -08:00
Simon Willison
640031edfd Fixed bug introduced in #1519 2021-11-19 17:01:17 -08:00
Simon Willison
fe687fd020 Fixed a whole bunch of broken base_url links
Refs #1519, #838
2021-11-19 16:53:11 -08:00
Simon Willison
1c13e1af06 Ensure query columns are included too, ref #1503 2021-11-13 21:08:33 -08:00
Simon Willison
c9e3cfecc8 Columns in filters now ignore ?_nocol, closes #1503 2021-11-13 20:53:00 -08:00
Simon Willison
8584993529 --cors Access-Control-Allow-Headers: Authorization
Refs #1467, refs https://github.com/simonw/datasette-auth-tokens/issues/4
2021-10-14 12:03:28 -07:00
Simon Willison
b50bf5d13f Don't persist _next in hidden field, closes #1483 2021-10-13 14:08:06 -07:00
Simon Willison
875117c343 Fix bug with ?_next=x&_sort=rowid, closes #1470 2021-10-09 18:14:56 -07:00
Simon Willison
adb5b70de5 Show count of facet values if ?_facet_size=max, closes #1423 2021-08-16 11:56:32 -07:00
Simon Willison
ca4f83dc7b Rename config= to settings=, refs #1432 2021-08-12 18:10:36 -07:00
Simon Willison
e837095ef3
Column metadata, closes #942 2021-08-12 16:53:23 -07:00
Simon Willison
fc4846850f New way of deriving named parameters using explain, refs #1421 2021-08-08 20:21:13 -07:00
Simon Willison
a390bdf9ce Stop using firstresult=True on render_cell, refs #1425
See https://github.com/simonw/datasette/issues/1425#issuecomment-894883664
2021-08-08 17:38:42 -07:00
Simon Willison
3bb6409a6c render_cell() can now return an awaitable, refs 2021-08-08 16:05:00 -07:00
Simon Willison
66e143c76e New hide_sql canned query option, refs #1422 2021-08-06 22:17:36 -07:00
Simon Willison
dd5ee8e668 Removed some unused imports
I found these with:

    flake8 datasette | grep unus
2021-07-15 23:26:12 -07:00
Simon Willison
a6c8e7fa4c Big performance boost for faceting, closes #1394 2021-07-14 17:05:43 -07:00
Simon Willison
83f6799a96 searchmode: raw table metadata property, closes #1389 2021-07-10 11:33:08 -07:00
Simon Willison
4a3e8561ab Default 405 for POST, plus tests 2021-06-23 15:40:09 -07:00
Simon Willison
d23a267138 Make request available to menu plugin hooks, closes #1371 2021-06-09 21:45:24 -07:00
Simon Willison
6e9b07be92 More inclusive language 2021-06-02 21:45:03 -07:00
Guy Freeman
0f41db1ba8
Avoid error sorting by relationships if related tables are not allowed
Refs #1306
2021-06-01 21:25:27 -07:00
Simon Willison
9552414e1f
Re-display user's query with an error message if an error occurs (#1346)
* Ignore _shape when returning errors
2021-06-01 20:46:20 -07:00
Simon Willison
0539bf0816 Don't execute facets/counts for _shape=array or object, closes #263 2021-06-01 19:53:00 -07:00
Simon Willison
a18e8641bc Don't reflect nofacet=1 and nocount=1 in BLOB URLs, refs #1353 2021-06-01 15:35:33 -07:00
Simon Willison
fd368d3b2c New _nocount=1 option, used to speed up CSVs - closes #1353 2021-06-01 09:12:32 -07:00
Simon Willison
8bde6c5461 Rename ?_nofacets=1 to ?_nofacet=1, refs #1353 2021-06-01 08:56:00 -07:00
Simon Willison
d1d06ace49 ?_trac=1 for CSV, plus ?_nofacets=1 when rendering CSV
Closes #1351, closes #1350
2021-06-01 08:49:50 -07:00
Simon Willison
c5ae1197a2 ?_nofacets=1 option, closes #1350 2021-05-30 22:39:14 -04:00
Simon Willison
f7d3e76fb3 Facets now execute ignoring ?_col and ?_nocol, fixes #1345 2021-05-30 22:31:14 -04:00