Wykres commitów

66 Commity (308bcc8805236b8eb5a08d8045c84f68bd0ddf0e)

Autor SHA1 Wiadomość Data
Simon Willison 98632f0a87
--secret command for datasette publish
Closes #787
2020-06-11 09:02:03 -07:00
Simon Willison 9f236c4c00 Warn that register_facet_classes may change, refs #830
Also documented policy that plugin hooks should not be shipped without a real example. Refs #818
2020-06-10 13:06:46 -07:00
Simon Willison fac8e93815 request.url_vars property, closes #822 2020-06-08 20:40:00 -07:00
Simon Willison db660db463 Docs + unit tests for Response, closes #821 2020-06-08 20:32:10 -07:00
Simon Willison f5e79adf26
register_routes() plugin hook (#819)
Fixes #215
2020-06-08 20:12:06 -07:00
Simon Willison e0a4664fba Better example plugin for permission_allowed
Also fixed it so default permission checks run after plugin permission checks, refs #818
2020-06-08 15:09:57 -07:00
Simon Willison c7d145e016 Updated example for extra_template_vars hook, closes #816 2020-06-08 12:06:05 -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 0c064c5fe2 More things you can do with plugins 2020-06-04 20:10:40 -07:00
Simon Willison 2074efa5a4 Another actor_from_request example 2020-06-04 18:38:32 -07:00
Simon Willison 8524866fdf Link to authentication docs 2020-06-04 16:58:19 -07:00
Simon Willison 461c82838d Implemented actor_from_request with tests, refs #699
Also added datasette argument to permission_allowed hook
2020-05-31 18:16:42 -07:00
Simon Willison 060a56735c actor_from_request and permission_allowed hookspecs, refs #699 2020-05-31 18:16:42 -07:00
Simon Willison 31fb006a9b Added datasette.get_database() method
Refs #576
2020-05-30 07:29:59 -07:00
Simon Willison 5ab411c733 can_render mechanism for register_output_renderer, closes #770 2020-05-27 22:57:05 -07:00
Simon Willison 57f48b8416 Made register_output_renderer callback optionally awaitable, closes #776 2020-05-27 19:43:30 -07:00
Simon Willison 52c4387c7d Redesigned register_output_renderer plugin hook, closes #581 2020-05-27 19:21:41 -07:00
Simon Willison 4b96857f17 Link to request object documentation, refs #706 2020-05-27 15:35:25 -07:00
Simon Willison af5702220c Added datasette-media plugin to the docs 2020-05-27 13:34:12 -07:00
Simon Willison 9e6075d21f rST fixes for register_output_renderer docs 2020-05-27 11:35:31 -07:00
Simon Willison 25014ca25e
Configuration directory mode, closes #731 2020-04-27 09:30:24 -07:00
Simon Willison 227bb3e91f
Added more example plugins 2020-04-22 06:47:20 -07:00
Simon Willison e0e7a0facf Removed Zeit Now v1 support, closes #710 2020-04-04 16:04:33 -07:00
Simon Willison 3b3cb3e8df Added example plugins to plugin hooks docs, closes #709 2020-03-24 15:29:34 -07:00
Simon Willison fd2a74dc09
Updated publish_subcommand example 2020-03-18 17:47:53 -07:00
Simon Willison 4933035b75
RST fix 2020-03-02 08:10:16 -08:00
Simon Willison 613f6fad72
Improved extra_template_vars documentation 2020-03-02 07:12:34 -08:00
Simon Willison a093c5f79f
.execute_write() and .execute_write_fn() methods on Database (#683)
Closes #682.
2020-02-24 20:45:07 -08:00
Simon Willison 6303ea5048 prepare_connection() now takes datasette and database args, refs #678 2020-02-21 17:32:40 -08:00
Simon Willison 3ffb8f3b98 .add_database() and .remove_database() methods, refs #671
Also made a start on the Datasette class documentation, refs #576
2020-02-13 17:27:57 -08:00
Simon Willison a562f29655 Examples of things you can do with plugins 2019-11-27 11:19:11 -08:00
Simon Willison aca41618f8 index view is also important for plugin hooks 2019-11-25 09:04:39 -08:00
Simon Willison 8c642f04e0
Render templates using Jinja async mode
Closes #628
2019-11-14 15:14:22 -08:00
Simon Willison ed57e4f990 Plugin static assets support both hyphens and underscores in names
Closes #611
2019-11-01 15:15:10 -07:00
Simon Willison 973f8f139d
--plugin-secret option for datasette publish
Closes #543

Also added new --show-files option to publish now and publish cloudrun - handy for debugging.
2019-07-07 19:06:31 -07:00
Simon Willison 9998f92cc0 Updated custom facet docs, closes #482 2019-07-07 16:19:02 -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 bd4dbc8519 Rename InterruptedError => QueryInterrupted, closes #490 2019-05-27 17:16:36 -07:00
Simon Willison 870f6dd55f Replaced a straggling 'datasette publish now' reference 2019-05-19 11:12:53 -07:00
Simon Willison a88b599cce Improved introduction copy on Plugins docs page 2019-05-15 22:18:02 -07:00
Russ Garrett bf229c9bd8 Pass view_name to extra_body_script hook (#443)
At the moment it's not easy to tell whether the hook is being called
in (for example) the row or table view, as in both cases the
`database` and `table` parameters are provided.

This passes the `view_name` added in #441 to the `extra_body_script`
hook.
2019-05-03 09:12:19 -04:00
Simon Willison ea66c45df9
Extract facet code out into a new plugin hook, closes #427 (#445)
Datasette previously only supported one type of faceting: exact column value counting.

With this change, faceting logic is extracted out into one or more separate classes which can implement other patterns of faceting - this is discussed in #427, but potential upcoming facet types include facet-by-date, facet-by-JSON-array, facet-by-many-2-many and more.

A new plugin hook, register_facet_classes, can be used by plugins to add in additional facet classes.

Each class must implement two methods: suggest(), which scans columns in the table to decide if they might be worth suggesting for faceting, and facet_results(), which executes the facet operation and returns results ready to be displayed in the UI.
2019-05-02 17:11:26 -07:00
Russ Garrett cf406c0754 New plugin hook: register_output_renderer hook (#441)
Thanks @russss!

* Add register_output_renderer hook

This changeset refactors out the JSON renderer and then adds a hook and
dispatcher system to allow custom output renderers to be registered.

The CSV output renderer is untouched because supporting streaming
renderers through this system would be significantly more complex, and
probably not worthwhile.

We can't simply allow hooks to be called at request time because we need
a list of supported file extensions when the request is being routed in
order to resolve ambiguous database/table names. So, renderers need to
be registered at startup.

I've tried to make this API independent of Sanic's request/response
objects so that this can remain stable during the switch to ASGI. I'm
using dictionaries to keep it simple and to make adding additional
options in the future easy.

Fixes #440
2019-05-01 16:01:56 -07:00
Simon Willison 436b8bc1d1 Datasette 0.27 2019-01-31 19:47:05 -08:00
Simon Willison 909cc8fbdf New 'datasette plugins' command to list installed plugins 2019-01-26 12:01:16 -08:00
Simon Willison 5b02611512
Corrected import path in plugin docs 2019-01-08 16:25:29 -08:00
Simon Willison 57a71377c9
Releasing Datasette 0.25 2018-09-19 19:48:12 +02:00