Wykres commitów

146 Commity (dda99fc09fb0b5523948f6d481c6c051c1c7b5de)

Autor SHA1 Wiadomość Data
Simon Willison dda99fc09f
New View base class (#2080)
* New View base class, closes #2078
* Use new View subclass for PatternPortfolioView
2023-05-25 17:18:43 -07:00
Simon Willison d97e82df3c
?_extra= support and TableView refactor to table_view
* Implemented ?_extra= option for JSON views, refs #262
* New dependency: asyncinject
* Remove now-obsolete TableView class
2023-03-22 15:49:39 -07:00
Simon Willison 9a1536b52a Move CORS headers into base class, refs #1922 2022-11-30 15:48:32 -08:00
Simon Willison 48725bb4ea CORS headers for write APIs, refs #1922 2022-11-30 09:27:10 -08:00
Simon Willison 8404b21556 405 method not allowed for GET to POST endpoints, closes #1916 2022-11-29 21:15:13 -08:00
Simon Willison ee64130fa8 Refactor to use new resolve_database/table/row methods, refs #1896 2022-11-18 14:46:25 -08:00
Simon Willison fb8b6b2311 Refactor _error helper function 2022-11-03 16:36:43 -07:00
Simon Willison 9b5a73ba4c Applied Black 2022-11-02 21:46:05 -07:00
Simon Willison 719e757252 Return method not allowed error in JSON in some situations
Added this while playing with the new API explorer, refs #1871
2022-11-02 20:12:13 -07:00
Simon Willison 000eeb4464 Link to Datasette API docs from /-/api, refs #1871 2022-11-01 22:45:05 -07:00
Simon Willison 93a02281da Show interrupted query in resizing textarea, closes #1876 2022-11-01 10:38:24 -07:00
Simon Willison 5f9f567acb Show SQL query when reporting time limit error, closes #1819 2022-09-26 16:06:01 -07:00
Simon Willison 194e4f6c3f Removed check_permission() from BaseView, closes #1677
Refs #1660
2022-03-21 11:41:56 -07:00
Simon Willison e627510b76 BaseView.check_permissions is now datasette.ensure_permissions, closes #1675
Refs #1660
2022-03-21 10:13:16 -07:00
Simon Willison 7a6654a253 Databases can now have a .route separate from their .name, refs #1668 2022-03-19 17:11:17 -07:00
Simon Willison 798f075ef9 Read format from route captures, closes #1667
Refs #1660
2022-03-19 13:32:29 -07:00
Simon Willison 61419388c1 Rename route match groups for consistency, refs #1667, #1660 2022-03-19 09:52:08 -07:00
Simon Willison d4f60c2388
Remove hashed URL mode
Also simplified how view class routing works.

Refs #1661
2022-03-18 17:12:03 -07:00
Simon Willison a35393b29c
Tilde encoding (#1659)
Closes #1657

Refs #1439
2022-03-15 11:01:57 -07:00
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 8d5779acf0 Refactored alternate_url_json mechanism, refs #1620, #1533 2022-02-02 13:32:47 -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 fe687fd020 Fixed a whole bunch of broken base_url links
Refs #1519, #838
2021-11-19 16:53:11 -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 ca4f83dc7b Rename config= to settings=, refs #1432 2021-08-12 18:10:36 -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 dd5ee8e668 Removed some unused imports
I found these with:

    flake8 datasette | grep unus
2021-07-15 23:26:12 -07:00
Simon Willison 4a3e8561ab Default 405 for POST, plus tests 2021-06-23 15:40:09 -07:00
Simon Willison 6e9b07be92 More inclusive language 2021-06-02 21:45:03 -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 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 a5ede3cdd4 Fixed bug loading database called 'test-database (1).sqlite'
Closes #1181.

Also now ensures that database URLs have special characters URL-quoted.
2021-01-24 21:13:05 -08:00
Miroslav Šedivý a882d67962
Modernize code to Python 3.6+ (#1158)
* Compact dict and set building
* Remove redundant parentheses
* Simplify chained conditions
* Change method name to lowercase
* Use triple double quotes for docstrings

Thanks, @eumiro!
2020-12-23 09:04:32 -08:00
Simon Willison 810853c5f2 Use time.perf_counter() instead of time.time(), closes #1157 2020-12-21 13:49:14 -08:00
Simon Willison ebc7aa287c In-memory _schemas database tracking schemas of attached tables, closes #1150 2020-12-18 14:34:05 -08:00
Simon Willison 2c0aca4887 _header=off option for CSV export, closes #1133 2020-12-10 15:28:44 -08:00
Simon Willison eae103a82b Write errors to stderr, closes #1131 2020-12-04 21:21:11 -08:00
Simon Willison a45a3dff3e Fix for OPTIONS request against /db, closes #1100 2020-12-02 16:49:55 -08:00
Simon Willison 49b6297fb7 Typo fix: messagge_is_html, closes #1118 2020-11-30 13:24:23 -08:00
Simon Willison f2e2bfcdd9 Renamed datasette.config() to .setting(), closes #1107 2020-11-24 14:06:32 -08:00
Simon Willison 30e64c8d3b
Use f-strings in place of .format()
Code transformed like so:

    pip install flynt
    flynt .
    black .
2020-11-15 15:24:22 -08:00
Simon Willison 11eb1e026f datasette.urls.table(..., format="json"), closes #1035
Also improved tests for datasette.urls and added format= to some other methods
2020-10-31 11:16:28 -07:00
Simon Willison f0a740ac21 Remove load_plugin hook - closes #1073
Refs #1042

This reverts commit 81dea4b07a.
2020-10-31 09:21:22 -07:00
Simon Willison 0cb29498c7 Fixed bug with python tests/fixtures.py
https://github.com/simonw/datasette/runs/1333357885?check_suite_focus=true
2020-10-30 10:54:47 -07:00
Simon Willison 81dea4b07a
load_template() plugin hook
Closes #1042
2020-10-30 10:47:18 -07:00
Simon Willison 178b7e8749 .csv now links to .blob downloads
Closes #1063, closes #1034
2020-10-29 15:47:32 -07:00