Simon Willison
09a3479a54
New "startup" plugin hook, closes #834
2020-06-13 10:55:41 -07:00
Simon Willison
fba8ff6e76
"$env": "X" mechanism now works with nested lists, closes #837
2020-06-11 17:21:48 -07:00
Simon Willison
57e812d5de
ds_author cookie can now expire, closes #829
...
Refs https://github.com/simonw/datasette-auth-github/issues/62#issuecomment-642152076
2020-06-10 12:39:54 -07:00
Simon Willison
f240970b83
Fixed tests/fixtures.py, closes #804
2020-06-09 12:58:12 -07:00
Simon Willison
f5e79adf26
register_routes() plugin hook ( #819 )
...
Fixes #215
2020-06-08 20:12:06 -07:00
Simon Willison
799c5d5357
Renamed resource_identifier to resource, refs #817
2020-06-08 11:59:53 -07:00
Simon Willison
c9f1ec616e
Removed resource_type from permissions system, closes #817
...
Refs #811 , #699
2020-06-08 11:51:03 -07:00
Simon Willison
abc7339124
Nicer pattern for make_app_client() in tests, closes #395
2020-06-07 14:14:10 -07:00
Simon Willison
4340845754
Nested permission checks for all views, refs #811
2020-06-07 13:03:08 -07:00
Simon Willison
86dec9e8ff
Added permission check to every view, closes #808
2020-06-06 22:30:36 -07:00
Simon Willison
3359d54a4e
Use cookies when accessing csrftoken_from
2020-06-06 12:33:08 -07:00
Simon Willison
070838bfa1
Better test for Vary header
2020-06-06 12:26:19 -07:00
Simon Willison
f786033a5f
Fixed 'datasette plugins' command, with tests - closes #802
2020-06-05 16:46:37 -07:00
Simon Willison
84a9c4ff75
CSRF protection ( #798 )
...
Closes #793 .
* Rename RequestParameters to MultiParams, refs #799
* Allow tuples as well as lists in MultiParams, refs #799
* Use csrftokens when running tests, refs #799
* Use new csrftoken() function, refs https://github.com/simonw/asgi-csrf/issues/7
* Check for Vary: Cookie hedaer, refs https://github.com/simonw/asgi-csrf/issues/8
2020-06-05 12:05:57 -07:00
Simon Willison
aa82d03704
Basic writable canned queries
...
Refs #698 . First working version of this feature.
* request.post_vars() no longer discards empty values
2020-06-03 08:16:50 -07:00
Simon Willison
4fa7cf6853
Flash messages mechanism, closes #790
2020-06-02 14:12:18 -07:00
Simon Willison
9f3d4aba31
--root option and /-/auth-token view, refs #784
2020-05-31 18:16:42 -07:00
Simon Willison
75cd432e5a
Ability to set custom table/view page size in metadata, closes #751
2020-05-27 22:00:04 -07:00
Simon Willison
446e5de65d
Refactored test plugins into tests/plugins, closes #775
2020-05-27 17:57:25 -07:00
Simon Willison
ad88c9b3f3
Mechanism for adding a default URL fragment to a canned query
...
Closes #767
2020-05-27 14:52:03 -07:00
Simon Willison
304e7b1d9f
Mechanism for creating custom pages using templates
...
Closes #648
2020-04-26 11:46:43 -07:00
Simon Willison
b07312c2b3
dedent SQL for neighborhood_search fixture
...
Makes this page a little prettier:
https://latest.datasette.io/fixtures/neighborhood_search
2020-04-02 17:54:27 -07:00
Simon Willison
2aaad72789
Refactor template setup into Datasette constructor
...
Closes #707
2020-03-26 18:12:43 -07:00
Simon Willison
7656fd64d8
base_url configuration setting, closes #394
...
* base_url configuration setting
* base_url works for static assets as well
2020-03-24 17:18:43 -07:00
Simon Willison
236aa065b2
"sort" and "sort_desc" metadata properties, closes #702
2020-03-21 19:28:35 -07:00
Simon Willison
7f5a330377
Don't count rows on homepage for DBs > 100MB ( #688 )
...
Closes #649 .
2020-02-28 17:08:29 -08:00
Kevin Keogh
3041c6b641
Use inspect-file, if possible, for total row count ( #666 )
...
For large tables, counting the number of rows in the table can take a
significant amount of time. Instead, where an inspect-file is provided
for an immutable database, look up the row-count for a plain count(*).
Thanks, @kevindkeogh
2020-02-25 12:19:29 -08:00
Simon Willison
7c6a9c3529
Better tests for prepare_connection() plugin hook, refs #678
2020-02-21 18:27:07 -08:00
Simon Willison
fd137da7f8
Suggest column facet only if at least one count > 1
...
Fixes #638
2019-11-21 16:56:55 -08:00
Simon Willison
8c642f04e0
Render templates using Jinja async mode
...
Closes #628
2019-11-14 15:14:22 -08:00
Simon Willison
28c4a6db5b
CREATE INDEX statements on table page, closes #618
2019-11-09 17:29:36 -08:00
Tobias Kunze
931bfc6661
Handle spaces in DB names ( #590 )
...
Closes #503 - thanks, @rixx
2019-11-04 15:16:30 -08:00
Simon Willison
14da70525b
Don't show 'None' as label for nullable foreign key, closes #406
2019-11-02 15:29:40 -07:00
Simon Willison
50287e7c6b
Only suggest array facet for arrays of strings - closes #562
2019-11-01 12:37:46 -07:00
Simon Willison
b647b5efc2
Fix for /foo v.s. /foo-bar issue, closes #597
...
Pull request #599
2019-10-18 15:51:07 -07:00
Simon Willison
90d4f497f9
Fix plus test for unicode characters in custom query name, closes #558
2019-07-13 19:49:24 -07:00
Simon Willison
fcfcae21e6
extra_template_vars plugin hook ( #542 )
...
* extra_template_vars plugin hook
Closes #541
* Workaround for cwd bug
Based on https://github.com/pytest-dev/pytest/issues/1235#issuecomment-175295691
2019-07-05 17:05:56 -07:00
Simon Willison
a2d4593193
Secret plugin configuration options ( #539 )
...
Closes #538
2019-07-03 22:36:44 -07:00
Simon Willison
4d2fdafe39
Added asgi_wrapper plugin hook, closes #520
2019-07-02 21:06:25 -07:00
Simon Willison
13e4f9a676
Unit test for _table custom template, refs #521
2019-07-02 20:23:05 -07:00
Simon Willison
ba8db9679f
Port Datasette from Sanic to ASGI + Uvicorn ( #518 )
...
Datasette now uses ASGI internally, and no longer depends on Sanic.
It now uses Uvicorn as the underlying HTTP server.
This was thirteen months in the making... for full details see the issue:
https://github.com/simonw/datasette/issues/272
And for a full sequence of commits plus commentary, see the pull request:
https://github.com/simonw/datasette/pull/518
2019-06-23 20:13:09 -07:00
Simon Willison
172da009d8
Added ?_through= table argument, closes #355
...
Also added much more interesting many-to-many fixtures - roadside attractions!
2019-05-22 22:45:12 -07:00
Simon Willison
967230c90e
Facet by date, closes #481
2019-05-20 23:09:22 -07:00
Simon Willison
f4eefdf193
Do not allow downloads of mutable databases - closes #474
2019-05-19 13:41:09 -07:00
Simon Willison
0dad111d24
New introspection endpoint: /-/databases - closes #470
...
Refs #419 and #465
2019-05-16 07:49:34 -07:00
Simon Willison
21b57cdf9a
serve --inspect-file=X now populates cached table counts
...
Closes #462
2019-05-16 07:30:32 -07:00
Simon Willison
5d6b2c30f1
Include views on homepage, fix table counts
...
If we have less than 5 tables we now also show one or more views in the
summary on the homepage.
Also corrected the logic for the row counts - we now count hidden and
visible tables separately.
Closes #373 , Refs #460
2019-05-15 17:28:07 -07:00
Simon Willison
e04511410f
Don't show hidden tables on index page, closes #455
...
Refs #460 . Also bulked out HTML index page unit tests.
2019-05-14 08:46:57 -07:00
Simon Willison
2db977d8f3
tests/fixtures.py can now write out plugins too
...
This command:
python tests/fixtures.py \
fixtures.db \
metadata.json \
fixtures-plugins/
Will now create the fixtures.db and metadata.json files, AND create
a folder called fixtures-plugins/ containing two test plugins.
You can then run it like this:
datasette fixtures.db \
-m metadata.json --plugins-dir=fixtures-plugins/
2019-05-09 09:44:21 -07:00
Simon Willison
35d6ee2790
Apply black to everything, enforce via unit tests ( #449 )
...
I've run the black code formatting tool against everything:
black tests datasette setup.py
I also added a new unit test, in tests/test_black.py, which will fail if the code does not
conform to black's exacting standards.
This unit test only runs on Python 3.6 or higher, because black itself doesn't run on 3.5.
2019-05-03 22:15:14 -04:00