Wykres commitów

1108 Commity (610425460b519e9c16d386cb81aa081c9d730ef0)

Autor SHA1 Wiadomość Data
Simon Willison a634121525
Make custom pages compatible with base_url setting
Closes #1238

- base_url no longer causes custom page routing to fail
- new route_path key in request.scope storing the path that was used for routing with the base_url prefix stripped
- TestClient used by tests now avoids accidentally double processing of the base_url prefix
2021-06-05 11:59:54 -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 f40d1b99d6 Don't show '0 results' on error page, refs #619 2021-06-01 21:09:10 -07:00
Simon Willison ea5b237800 Show error message on bad query, closes #619 2021-06-01 20:59:29 -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 0f1e47287c Fixed bug with detect_fts for table with single quote in name, closes #1257 2021-06-01 20:27:04 -07:00
Simon Willison 807de378d0 /-/databases and homepage maintain connection order, closes #1216 2021-06-01 20:10:15 -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
Simon Willison 7b106e1060 Release 0.57a1
Refs #1319, #1320, #1331, #1337, #1338, #1341
2021-05-27 09:54:21 -07:00
Simon Willison 1a8972f9c0
Upgrade Heroku runtime to python-3.8.10 2021-05-27 09:11:03 -07:00
Simon Willison 7e983fede6 ?_facet_size=max, ... now links to that, closes #1337
Refs #1332
2021-05-27 09:00:58 -07:00
Simon Willison 51d7881140 'Show all columns' menu item if any _col= set, closes #1341
Refs #615
2021-05-26 21:31:12 -07:00
Simon Willison f1c29fd6a1
?_col=/?_nocol= to show/hide columns on the table page
Closes #615

* Cog icon for hiding columns
* Show all columns cog menu item
* Do not allow hide column on primary keys
* Allow both ?_col= and ?_nocol=
* De-duplicate if ?_col= passed multiple times
* 400 error if user tries to ?_nocol= a primary key
* Documentation for ?_col= and ?_nocol=
2021-05-26 21:17:43 -07:00
Simon Willison eae3084b46 Fixed another Jinja warning, refs #1338 2021-05-24 10:52:09 -07:00
Simon Willison 2bd9d54b27 Fix Jinja warnings, closes #1338, refs #1331 2021-05-23 18:41:50 -07:00
Simon Willison a443dba82f Release 0.57a0
Refs #1281, #1282, #1289, #1290, #1308, #1313, #1314, #1321, #1323, #1325, #1330, #1332, #1335
2021-05-22 17:45:54 -07:00
Simon Willison 9789b94da4 ?_facet_size=100 parameter, closes #1332 2021-05-22 17:34:33 -07:00
Simon Willison a4bb2abce0 Show primary key cells in bold without affecting columns called 'link', closes #1308 2021-04-23 23:07:37 -07:00
Simon Willison 87b583a128 Clearer help text for --reload
Immutable databases are not commonly used, but it's useful to clarify
that --reload will pick up on changes to metadata.
2021-04-02 13:20:51 -07:00
Marjorie Roswell 7b1a9a1999
Fix little typo (#1282) 2021-03-29 12:57:34 -07:00
Simon Willison af5a7f1c09 Release 0.56
Refs #1005, #1031, #1141, #1229, #1236, #1239, #1246, #1247, #1252, #1266, #1276, #1278
2021-03-28 17:41:12 -07:00
Simon Willison d579fcf4f7 Applied some fixes suggested by @withshubh in #1260 2021-03-28 17:20:55 -07:00
Campbell Allen f92d823766
ensure immutable databses when starting in configuration directory mode with (#1229)
* check if immutables is empty list of None
* update docs on how to create the inspect-data.json
2021-03-28 17:17:31 -07:00
Bob Whitelock e72397d65b
Add styling to lists within table cells (fixes #1141) (#1252)
This overrides the Datasette reset (see
d0fd833b8c/datasette/static/app.css (L35-L38)),
to add back the default styling of list items displayed within Datasette
table cells.
2021-03-28 17:14:04 -07:00
Simon Willison 48d5e0e6ac Fix for no such table: pragma_database_list, refs #1276 2021-03-28 16:44:29 -07:00
Simon Willison 6ad544df5e Fixed master -> main in a bunch of places, mainly docs 2021-03-23 09:19:41 -07:00
Konstantin Baikov 8e18c79431
Use context manager instead of plain open (#1211)
Context manager with open closes the files after usage.

When the object is already a pathlib.Path i used read_text
write_text functions

In some cases pathlib.Path.open were used in context manager,
it is basically the same as builtin open.

Thanks, Konstantin Baikov!
2021-03-11 08:15:49 -08:00
Simon Willison 7c87532acc New .add_memory_database() method, closes #1247 2021-02-28 20:02:18 -08:00
Simon Willison 47eb885cc2 JSON faceting now suggested even if column has blank strings, closes #1246 2021-02-28 19:44:04 -08:00
Simon Willison 726f781c50 Fix for arraycontains bug, closes #1239 2021-02-22 16:22:47 -08:00
Simon Willison 1f9cca33b4 Resizable SQL editor using cm-resize, refs #1236 2021-02-19 15:47:52 -08:00
Simon Willison cb8a293bd7 Release 0.55
Refs #1205, #1207, #1214, #1221, #1226, #1227, #1232, #1235
2021-02-18 18:01:06 -08:00
Simon Willison 6f41c8a2be
--crossdb option for joining across databases (#1232)
* Test for cross-database join, refs #283
* Warn if --crossdb used with more than 10 DBs, refs #283
* latest.datasette.io demo of --crossdb joins, refs #283
* Show attached databases on /_memory page, refs #283
* Documentation for cross-database queries, refs #283
2021-02-18 14:09:12 -08:00
Simon Willison 36a44bffbf Validation for --port, closes #1226 2021-02-18 10:05:27 -08:00
Simon Willison eda652cf6e
--ssl-keyfile and --ssl-certfile options to "datasette serve"
Closes #1221
2021-02-11 16:52:16 -08:00
Simon Willison 3a3de76009 Release 0.54.1
Refs #1214
2021-02-02 13:24:05 -08:00
Simon Willison 7a2ed9f8a1 Fixed bug with ?_sort= and ?_search=, closes #1214 2021-02-02 13:21:03 -08:00
Simon Willison 1600d2a3ec Renamed /:memory: to /_memory, with redirects - closes #1205 2021-01-28 14:48:56 -08:00
Simon Willison 0b9ac1b2e9
Release 0.54
Refs #509, #1091, #1150, #1151, #1166, #1167, #1178, #1181, #1182, #1184, #1185, #1186, #1187, #1194, #1198
2021-01-25 09:33:29 -08: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
Simon Willison 07e1635615 All ?_ parameters now copied to hidden form fields, closes #1194 2021-01-24 19:10:10 -08:00
Simon Willison 25c2933667 publish heroku now uses python-3.8.7 2021-01-22 16:46:25 -08:00
Simon Willison 57f4d7b82f Release 0.54a0
Refs #1091, #1145, #1151, #1156, #1157, #1158, #1166, #1170, #1178, #1182, #1184, #1185, #1186, #1187
2021-01-19 12:47:30 -08:00
Simon Willison c38c42948c extra_body_script module support, closes #1187 2021-01-13 18:14:33 -08:00
Simon Willison fa0c3777b8 script type=module support, closes #1186 2021-01-13 17:50:52 -08:00
Simon Willison 640ac7071b Better PRAGMA error message, closes #1185 2021-01-12 14:26:19 -08:00
Simon Willison 8e8fc5cee5 Applied Black 2021-01-11 13:34:38 -08:00
Simon Willison 649f48cd70 request.full_path property, closes #1184 2021-01-11 13:32:58 -08:00
Simon Willison e1efa9b7a3 force_https_urls on for publish cloudrun, refs #1178 2021-01-06 10:13:34 -08:00
Simon Willison a93a65b027
Fixed Prettier formatting, closes #1166 2020-12-31 13:46:32 -08:00
Simon Willison 80870911de
Trying out bad formatting, refs #1166 2020-12-31 13:44:47 -08:00
Simon Willison 5193d0b3e4 Apply prettier to table.js, refs #1166 2020-12-31 13:27:39 -08:00
Simon Willison 6705560148 Refactor out sqlite_extensions option 2020-12-29 14:16: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 90eba4c3ca Prettier CREATE TABLE SQL for _internal 2020-12-22 15:55:43 -08:00
Simon Willison 8919f99c2f Improved .add_database() method design
Closes #1155 - _internal now has a sensible name

Closes #509 - Support opening multiple databases with the same stem
2020-12-22 12:04:18 -08:00
Simon Willison 270de6527b Foreign keys for _internal database
Refs #1099 - Datasette now uses compound foreign keys internally,
so it would be great to link them correctly.
2020-12-22 11:48:54 -08:00
Simon Willison bc1f1e1ce8 Compound primary key for foreign_keys table in _internal 2020-12-22 11:04:29 -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 dcdfb2c301 Rename _schemas to _internal, closes #1156 2020-12-21 11:48:06 -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 5e9895c67f Database(memory_name=) for shared in-memory databases, closes #1151 2020-12-17 17:01:18 -08:00
Simon Willison 0c616f732c Release 0.53
Refs #1132, #1135, #1133, #1138, #1137
2020-12-10 17:44:36 -08:00
Simon Willison 967cc05545 Powered by links to datasette.io, closes #1138 2020-12-10 15:37:08 -08:00
Simon Willison 2c0aca4887 _header=off option for CSV export, closes #1133 2020-12-10 15:28:44 -08:00
Simon Willison 387b471b88 Release 0.52.5
Refs #1134
2020-12-09 12:13:14 -08:00
Simon Willison 6000d1a724 Fix for combining ?_search_x and ?_searchmode=raw, closes #1134 2020-12-09 11:56:44 -08:00
Simon Willison fe86d85308 datasette serve --create option, closes #1135 2020-12-09 11:45:45 -08:00
Simon Willison 4c25b035b2 arraynotcontains filter, closes #1132 2020-12-07 14:41:03 -08:00
Simon Willison 2dc281645a Release 0.52.4
Refs #1125, #1131, #1094
2020-12-05 11:41:40 -08:00
Abdussamet Koçak 705d1a1555
Fix startup error on windows (#1128)
Fixes https://github.com/simonw/datasette/issues/1094

This import isn't used at all, and causes error on startup on Windows.
2020-12-05 11:35:03 -08:00
Simon Willison eae103a82b Write errors to stderr, closes #1131 2020-12-04 21:21:11 -08:00
Simon Willison 49d8fc0568 Try pysqlite3-binary version as well, refs #1125 2020-12-03 20:07:16 -08:00
Simon Willison 00185af74a Show pysqlite3 version on /-/versions, if installed - #1125 2020-12-03 14:08:50 -08:00
Simon Willison 4cce551666 Release 0.52.3
Refs #1124
2020-12-03 11:07:05 -08:00
Simon Willison ca6e8e53dc More helpful 404 messages, refs #1124 2020-12-03 11:05:12 -08:00
Simon Willison 63efcb35ce More tweaks to root_path handling, refs #1124 2020-12-03 11:02:53 -08:00
Simon Willison 6b4c55efea Fix for Amazon Linux static assets 404ing, refs #1124 2020-12-03 10:53:26 -08:00
Simon Willison e048791a9a Release 0.52.2
Refs #1116, #1115, #1100, #749, #1121
2020-12-02 16:57:40 -08:00
Simon Willison a45a3dff3e Fix for OPTIONS request against /db, closes #1100 2020-12-02 16:49:55 -08:00
Abdussamet Koçak daae35be46
Fix misaligned table actions cog
Closes #1121. Thanks, @abdusco
2020-12-02 16:33:36 -08:00
Simon Willison 88ac538b41 transfer-encoding: chunked for DB downloads, refs #749
This should get >32MB downloads working on Cloud Run.
2020-12-02 15:47:37 -08:00
Simon Willison 17cbbb1f7f
generated_columns table in fixtures.py, closes #1119 2020-11-30 16:28:02 -08:00
Simon Willison 461670a0b8
Support for generated columns
* Support for generated columns, closes #1116
* Show SQLite version in pytest report header
* Use table_info() if SQLite < 3.26.0
* Cache sqlite_version() rather than re-calculate every time
* Adjust test_database_page for SQLite 3.26.0 or higher
2020-11-30 13:29:57 -08:00
Simon Willison 49b6297fb7 Typo fix: messagge_is_html, closes #1118 2020-11-30 13:24:23 -08:00
Simon Willison dea3c508b3 Revert "Support for generated columns, closes #1116" - it failed CI
This reverts commit 37f87b5e52.
2020-11-30 12:09:32 -08:00
Simon Willison 37f87b5e52 Support for generated columns, closes #1116 2020-11-30 12:01:15 -08:00
Simon Willison c745c2715a Moved comment for clarity 2020-11-29 12:27:34 -08:00
Simon Willison 09033c08be Suggest --load-extension=spatialite, closes #1115 2020-11-29 12:13:16 -08:00
Simon Willison 242bc89fdf Release 0.52.1
Refs #1098, #1102, #1114
2020-11-29 11:38:29 -08:00
Simon Willison deb0be4ae5 Fix bug where compound foreign keys produced broken links, closes #1098 2020-11-29 11:30:17 -08:00
Simon Willison e800ffcf7c
/usr/local/lib/mod_spatialite.so
Closes #1114
2020-11-29 09:37:43 -08:00
Simon Willison a8e66f9065 Release 0.52
Refs #992, #1103, #1104, #1107, #1077, #1110, #1089, #1086, #1088, #1084
2020-11-28 15:54:35 -08:00
Simon Willison 37d18a5bce datasette publish cloudrun --apt-get-install, closes #1110 2020-11-24 19:05:35 -08:00
Simon Willison f2e2bfcdd9 Renamed datasette.config() to .setting(), closes #1107 2020-11-24 14:06:32 -08:00
Simon Willison 5a77f7a649 Updated docs renaming config to settings
- config.html is now settings.html
- ConfigOption in app.py is now Setting
- updated documentation unit tests

Refs #1106
2020-11-24 13:22:33 -08:00
Simon Willison 33eadb8782 config.json is now settings.json, closes #1104 2020-11-24 12:37:29 -08:00
Simon Willison 2a3d5b720b Redirect /-/config to /-/settings, closes #1103 2020-11-24 12:19:14 -08:00
Simon Willison 3159263f05 New --setting to replace --config, closes #992 2020-11-24 12:01:47 -08:00
Simon Willison 4bac9f18f9 Fix off-screen action menu bug, refs #1084 2020-11-21 15:33:04 -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 253f2d9a3c Use correct QueryInterrupted exception on row page, closes #1088 2020-11-11 20:36:44 -08:00
Simon Willison 2a981e2ac1 Blank foreign key labels now show as hyphens, closes #1086 2020-11-11 15:44:04 -08:00
Simon Willison d6257e3a7b Add database/table actions to pattern portfolio
Refs #1066, #1077
2020-11-02 10:53:52 -08:00
Simon Willison 7b19492070 database_actions() plugin hook, closes #1077 2020-11-02 10:27:25 -08:00
Simon Willison b61f6cceb5 Add nav menu to pattern portfolio 2020-11-01 09:22:13 -08:00
Simon Willison 4785172bbc Release 0.51.1 2020-10-31 20:33:47 -07:00
Simon Willison d53d747e6a Release 0.51
Refs #1014, #1016, #1019, #1023, #1027, #1028, #1033, #1034, #1036, #1039

Closes #1076
2020-10-31 15:21:49 -07:00
Simon Willison a4ca26a265 Address PrefixedUrlString bug in #1075 2020-10-31 13:35:47 -07:00
Simon Willison 84bc7244c1 datasette.client now applies base_url, closes #1026 2020-10-31 12:29:42 -07:00
Simon Willison 7a67bc7a56 datasette.urls methods will not apply base_url prefix twice, refs #1026 2020-10-31 12:11:40 -07:00
Simon Willison c1d386ef67 Refactor Urls into url_builder.py
Refs #1026
2020-10-31 11:43:36 -07: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 a2a7090720 Display messages in right place, closes #1071 2020-10-30 13:12:57 -07:00
Simon Willison 393f1b49d7 Updated nav in pattern portfolio 2020-10-30 13:12:01 -07:00
Simon Willison 59ab24af6b Release 0.51a2
Refs #1068, #1042, #1054
2020-10-30 10:56:02 -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 fcf43589eb Link to homepage in nav on show-json page 2020-10-30 08:54:01 -07:00
Simon Willison 222f79bb4c debug-menu permission, closes #1068
Also added tests for navigation menu logic.
2020-10-30 08:41:57 -07:00
Simon Willison 9f0987cb57 cursor: pointer; on the new menu icons
Refs #1064, #1066
2020-10-29 22:55:10 -07:00
Simon Willison 0e1e89c6ba Release 0.51a1
Refs #1056, #1039, #998, #1045, #1033, #1036, #1034, #976, #1057, #1058, #1053, #1064, #1066
2020-10-29 22:35:23 -07:00
Simon Willison 2f7731e9e5 table_actions() plugin hook plus menu, closes #1066
Refs #690
2020-10-29 22:16:41 -07:00
Simon Willison 8a4639bc43 Applied Black 2020-10-29 22:14:33 -07:00
Simon Willison 561c1d2d36 Show logout link if they are logged in AND have ds_actor cookie
Otherwise an expired cookie will still cause the logout link to show.
2020-10-29 20:51:37 -07:00
Simon Willison 18a64fbb29
Navigation menu plus menu_links() hook
Closes #1064, refs #690.
2020-10-29 20:45:15 -07:00
Simon Willison 178b7e8749 .csv now links to .blob downloads
Closes #1063, closes #1034
2020-10-29 15:47:32 -07:00
Simon Willison 78b3eeaad9
.blob output renderer
* _blob_hash= checking plus refactored to use new BadRequest class, refs #1050
* Replace BlobView with new .blob renderer, closes #1050
* .blob downloads on arbitrary queries, closes #1051
2020-10-29 15:01:38 -07:00
Simon Willison 89519f9a37 Fixed bug with download of BLOB null, refs #1050 2020-10-28 21:05:40 -07:00
Simon Willison cefd058c1c
New explicit versioning mechanism
Closes #1054
2020-10-28 20:38:15 -07:00
Simon Willison abcf022249
Margin bottom on metadata description 2020-10-28 10:11:07 -07:00
Simon Willison 7d9fedc176 Cascading permissions for .db download, closes #1058 2020-10-27 20:15:41 -07:00
Simon Willison c3aba4aa98 --cors for /name.db downloads, refs #1057 2020-10-27 13:39:57 -07:00
Simon Willison e7dd3434e1 No underline on nav links in header 2020-10-27 12:39:55 -07:00
Simon Willison 18977ce802 Off-white yellow is now off-white blue 2020-10-27 12:39:55 -07:00
Simon Willison c069d481af Mobile view cards now have rounded corners 2020-10-27 12:39:55 -07:00
Simon Willison f49d15a758 word-break: break-word; 2020-10-27 12:39:55 -07:00
Simon Willison dab4b73f7d White cards on mobile 2020-10-27 12:39:55 -07:00
Simon Willison 62286b46a9 Tighten up table column CSS 2020-10-27 12:39:55 -07:00
Simon Willison fe5e813f06 Styled facets with different bullets 2020-10-27 12:39:55 -07:00
Natalie Downe df19a48a3b Implemented new Natalie design 2020-10-27 12:39:55 -07:00
Natalie Downe 6dff22eff8 Visited link colours 2020-10-27 12:39:55 -07:00
Natalie Downe 7d69f1ac02 New header and footer 2020-10-27 12:39:55 -07:00
Simon Willison 26bb4a2681 table-wrapper on query page too, refs ##998 2020-10-27 00:56:35 -07:00
Simon Willison f5dbe61a45 -o now opens to most relevant page, closes #976 2020-10-25 22:06:20 -07:00
Simon Willison 105a2c10fd Fix z-index issue with dropdown menu, closes #1052 2020-10-25 19:19:21 -07:00
Simon Willison 6c9fd4ef1b Better download link display on mobile, refs #1046 2020-10-24 18:00:38 -07:00
Simon Willison 5db7ae3ce1 Link to BLOB downloads, closes #1046 2020-10-24 17:13:14 -07:00
Simon Willison 5a15197960
/db/table/-/blob/pk/column.blob download URL, refs #1036 2020-10-24 16:09:18 -07:00
Simon Willison 10c35bd371 urls.static_plugins() method, closes #1033
Also documented how to package static assets and templates in plugins, closes #575
2020-10-24 13:03:40 -07:00
Simon Willison 20f8659e2a Wide tables now scroll horizontally, refs #998 2020-10-21 18:09:01 -07:00
Simon Willison bf82b3d6a6 scale-in animation for column action menu, closes #1039 2020-10-21 10:02:26 -07:00
Simon Willison 091441a444 Fixed remaining places that needed datasette.urls, closes #1025 2020-10-19 22:21:19 -07:00
Simon Willison 0d1763fb2f More datasette.urls usage, refs #1025 2020-10-19 21:24:47 -07:00
Simon Willison 310c3a3e05 New datasette.urls URL builders, refs #904 2020-10-19 17:33:59 -07:00
Simon Willison 6aa5886379 --load-extension=spatialite shortcut, closes #1028 2020-10-19 15:37:43 -07:00
Simon Willison a4def0b8db Clearer _sort_by_desc comment 2020-10-19 15:37:43 -07:00
Simon Willison f3a087a578 Edit SQL button on canned queries, closes #1019 2020-10-13 20:44:18 -07:00
Simon Willison acf07a6772 x button for clearing filters, refs #1016 2020-10-11 19:53:26 -07:00
Simon Willison e34e84901d Link: HTTP header pagination, closes #1014 2020-10-10 17:18:45 -07:00
Simon Willison 7e70643852 Removed --debug option, which didn't do anything - closes #814 2020-10-10 16:39:38 -07:00
Simon Willison 7239175f63 Fixed broken column header links, closes #1011 2020-10-09 20:51:56 -07:00
Simon Willison 9f6dd985bc Fix broken CSV/JSON export on query page, refs #1010 2020-10-09 17:39:45 -07:00
Simon Willison c13d184704 Emergency fix for broken links in 0.50, closes #1010 2020-10-09 17:33:13 -07:00
Simon Willison 8f97b9b58e
datasette.client internal requests mechanism
Closes #943

* Datasette now requires httpx>=0.15
* Support OPTIONS without 500, closes #1001
* Added internals tests for datasette.client methods
* Datasette's own test mechanism now uses httpx to simulate requests
* Tests simulate HTTP 1.1 now
* Added base_url in a bunch more places
* Mark some tests as xfail - will remove that when new httpx release ships: #1005
2020-10-09 09:11:24 -07:00
Simon Willison 7249ac5ca0 Support OPTIONS without 500, closes #1001 2020-10-08 18:43:53 -07:00
Simon Willison e4554c37b7 datasette publish heroku --tar option, closes #969 2020-10-08 16:30:46 -07:00
Simon Willison 107d0887a6 datasette publish heroku now uses Python 3.8.6 2020-10-08 16:22:11 -07:00
Simon Willison 86823ae6f7 Default to Uvicorn workers=1, refs #999 2020-10-08 16:16:55 -07:00
Simon Willison 5070425817 Fix handling of nested custom page wildcard paths, closes #996 2020-10-07 15:51:11 -07:00
Simon Willison 5a184a5d21 Display column type in column action menu, closes #993
Also added new documented db.table_column_details() introspection method.
2020-10-05 17:32:10 -07:00
Simon Willison e807c4eac0 Sort links remove _next=, closes #989 2020-10-04 11:05:20 -07:00
Simon Willison 5d6bc4c268 Allow faceting on compound primary keys, closes #985 2020-10-01 09:50:35 -07:00
Simon Willison 141544613f Extract out menu icon CSS, refs #981 2020-09-30 16:55:00 -07:00
Simon Willison 64127a4593 Show not-blank rows column action, refs #981 2020-09-30 16:43:34 -07:00
Simon Willison 765e8f0209 Close menu when clicked outside, refs #981 2020-09-30 16:21:44 -07:00
Simon Willison 0f2626868b Much improved column menu display logic, refs #981
* Menu links now take into account existing querystring
* No longer shows facet option for primary key columns
* Conditionally displays sort/sort-desc if already sorted
* Does not show facet option if already faceted by this
2020-09-30 16:01:37 -07:00
Simon Willison fd0b00330f Don't show cog on Link column, refs #981
Also show ascending option before descending option
2020-09-30 15:31:17 -07:00
Simon Willison ae1f7c3870 Column action menu for sort/faceting, refs #981 2020-09-30 14:43:39 -07:00
Simon Willison 5b8b8ae597 Handle \r\n correctly in CSS escapes, refs #980 2020-09-29 12:16:30 -07:00
Simon Willison c11383e628 Fix rendering glitch with columns on mobile, closes #978 2020-09-28 15:42:50 -07:00
Simon Willison cac051bb8a Fix for 'open' bug, closes #973 2020-09-22 08:39:48 -07:00
Simon Willison a980199e61 New -o option for opening Datasette in your browser, closes #970 2020-09-22 07:26:47 -07:00
Simon Willison 432a3d675f sqlite3.enable_callback_tracebacks(True), closes #891 2020-09-15 14:59:17 -07:00
Simon Willison 448d13ea6b Fix for MagicParameters error with no POST body, closes #967 2020-09-15 13:12:57 -07:00
Simon Willison 65ca17d729 Fix for DeprecationWarning: invalid escape sequence 2020-09-15 13:10:38 -07:00
Simon Willison 72ac2fd32c JSON API for writable canned queries, closes #880 2020-09-14 14:23:18 -07:00
Simon Willison 896fce228f Canned query writes support JSON POST body, refs #880 2020-09-14 13:18:15 -07:00
Simon Willison 3817152e31 Rename default error template to error.html, refs #965 2020-09-14 11:30:31 -07:00
Simon Willison 699be7dea9 raise_404() function for use in custom templates, closes #964 2020-09-14 10:39:25 -07:00
Simon Willison cc77fcd133 Optional path parameters for custom pages, closes #944 2020-09-13 19:34:43 -07:00
Simon Willison ea340cf320 Correctly persist selected facets in hidden fields
Closes #963
2020-09-12 14:54:01 -07:00
Simon Willison d02f6151da datasette --get status code for error pages, closes #947 2020-09-11 14:32:54 -07:00
Simon Willison ca5c405d0f New 'datasette --pdb' option, closes #962 2020-09-11 11:37:55 -07:00
Simon Willison d0c752d50c Fixed a couple of tiny HTML bugs, thanks curlylint
curlylint datasette/templates

https://github.com/thibaudcolas/curlylint
2020-09-07 08:43:37 -07:00
Simon Willison a648bb82ba Upgrade to Black 20.8b1, closes #958 2020-09-02 15:24:55 -07:00
Simon Willison 26b2922f17 await_me_maybe utility function 2020-09-02 15:21:12 -07:00
Simon Willison 9dbbfa1f0b Upgrade CodeMirror to 5.57.0, refs #948 2020-08-30 10:39:16 -07:00
Simon Willison 799ecae948 register_output_renderer can now return Response, closes #953 2020-08-27 21:02:50 -07:00
Simon Willison 69033c6ec4 datasette install --upgrade option, closes #945 2020-08-19 10:20:41 -07:00
Simon Willison b21ed237ab
publish heroku now deploys with Python 3.8.5 2020-08-18 13:49:13 -07:00
Simon Willison 8e7e6458a6 Fix bug with ?_nl=on and binary data, closes #914 2020-08-16 11:26:49 -07:00
Simon Willison 3a4c8ed36a Added columns argument to various extra_ plugin hooks, closes #938 2020-08-16 11:09:53 -07:00
Simon Willison e3639247cd Standard arguments for extra_ plugin hooks, closes #939 2020-08-16 09:50:23 -07:00
Simon Willison 41ddc19756
Docs now live at docs.datasette.io (#937) 2020-08-15 16:57:05 -07:00
Simon Willison b86f94883b
Don't hang in db.execute_write_fn() if connection fails
Closes #935

Refs https://github.com/simonw/latest-datasette-with-all-plugins/issues/3
2020-08-15 15:35:31 -07:00
Simon Willison 45414f8412 --get now calls startup() plugin hooks, closes #934 2020-08-15 13:52:41 -07:00
Simon Willison e139a7619f
'datasette --get' option, closes #926
Also made a start on the datasette.utils.testing module, refs #898
2020-08-11 17:24:40 -07:00
Simon Willison afdeda8216 Use runpy in install/uninstall, refs #928 2020-08-11 16:54:52 -07:00
Simon Willison f7fddc9019 Fixed typo in help text, refs #925 2020-08-11 15:33:16 -07:00
Simon Willison 01fe5b7401 datasette install / datasette uninstall commands, closes #925 2020-08-11 15:32:06 -07:00
Simon Willison 7f10f0f766 Fix for security issue #918 2020-08-09 09:03:35 -07:00
fcatus 2d7fa8b905
Use None as a default arg (#901)
Thanks, @fcatus!

* Use None as a default arg
* Black formatting fix

Co-authored-by: Simon Willison <swillison@gmail.com>
2020-07-31 11:42:38 -07:00
Simon Willison 0748a65a22 Fixed content-disposition header on DB download, closes #909 2020-07-29 14:34:22 -07:00
Simon Willison 092874202c Improvements to allow block logic and debug tool
true and false allow block values are now supported, closes #906

Added a bunch of demo links to the documentation, refs #908
2020-07-24 17:04:06 -07:00
Simon Willison 88065fb74f Increase size of allow/actor fields, refs #908 2020-07-24 16:52:16 -07:00
Simon Willison 12c0bc09cc /-/allow-debug tool, closes #908 2020-07-24 15:55:10 -07:00
Simon Willison 213e6a8926 content-length for DB downloads, closes #905 2020-07-21 21:52:35 -07:00
Simon Willison 1f6a134369 await request.post_body() method, closes #897 2020-07-17 13:12:35 -07:00
Simon Willison c5f06bc356
"white-space: pre-wrap" for all table cells, refs #896 2020-07-16 12:06:45 -07:00
Amjith Ramanujam ea99a4431c
Only load Python files from plugins-dir
Pull request #890. Thanks, @amjith!

* Load only python files from plugins-dir
* Add a test to verify non-python files are not loaded as plugins
2020-07-02 20:08:32 -07:00
Simon Willison 57879dc8b3 Better titles for canned query pages, closes #887 2020-07-01 17:23:37 -07:00
Simon Willison c7e8a4aaac Handle missing request object, refs #884 2020-07-01 14:36:36 -07:00
Simon Willison 1bae24691f Only show 'log out' if ds_cookie present, closes #884 2020-07-01 14:25:59 -07:00
Simon Willison 549b1c2063 New forbidden() plugin hook, closes #812 2020-06-30 21:17:38 -07:00
Simon Willison 2b85bbdd45 Added logout button to pattern portfolio, closes #876
Refs #875
2020-06-30 16:47:23 -07:00
Simon Willison d6e03b0430 Cascading view permissions, closes #832
- If you have table permission but not database permission you can now view the table page
- New BaseView.check_permissions() method
2020-06-30 16:40:50 -07:00
Simon Willison ab76eddf31 Express no opinion if allow block is missing
Default permission policy was returning True by default for permission
checks - which means that if allow was not defined for a level it would
be treated as a passing check.

This is better: we now return None of the allow block is not defined,
which means 'I have no opinion on this' and allows other code to make
its own decisions.

Added while working on #832
2020-06-30 15:49:06 -07:00
Simon Willison 9ac6292614 _header_x now defaults to empty string
Prior to this a request to e.g. https://latest.datasette.io/fixtures/magic_parameters
which did not include a User-Agent header would trigger a 500 error.
2020-06-30 15:00:17 -07:00
Simon Willison 2115d7e345 Logout link in nav, refs #875 2020-06-29 11:40:40 -07:00
Simon Willison 51427323e6 Add message when user logs out, refs #840 2020-06-29 11:31:35 -07:00
Simon Willison 16f592247a Use explicit lifestyle=on for Uvicorn, refs #873 2020-06-29 08:42:50 -07:00
Simon Willison 35aee82c60 Fixed 500 error with /favicon.ico, closes #874 2020-06-28 21:27:11 -07:00
Simon Willison 22d932fafc /-/logout page for logging out of ds_actor cookie
Refs #840
2020-06-28 21:17:58 -07:00
Simon Willison a8a5f81372 Made show_messages available to plugins, closes #864 2020-06-28 17:50:47 -07:00
Simon Willison 7ac4936cec .add_message() now works inside plugins, closes #864
Refs #870
2020-06-28 17:25:35 -07:00
Simon Willison af350ba457 Use single Request created in DatasetteRouter, refs #870 2020-06-28 17:01:33 -07:00
Simon Willison 4dad028432 BaseView.as_asgi is now .as_view, refs #870 2020-06-28 16:47:40 -07:00
Simon Willison 3bc2461c77 Refactored AsgiView into BaseView, refs #870 2020-06-28 16:06:30 -07:00
Simon Willison a8bcafc177 Refactored out AsgiRouter, refs #870 2020-06-28 13:45:17 -07:00
Simon Willison 0991ea75cc Renamed _timestamp to _now, refs #842, closes #871 2020-06-28 12:47:28 -07:00
Simon Willison 563f5a2d3a
Magic parameters for canned queries
Closes #842

Includes a new plugin hook, register_magic_parameters()
2020-06-27 19:58:16 -07:00