Skip to content

Commit f1f581b

Browse files
committed
Release notes for 0.45
Refs #687, #807, #812, #832, #834, #835, #840, #842, #846, #852, #854, #863, #864, #870
1 parent c7e8a4a commit f1f581b

2 files changed

Lines changed: 44 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Datasette is aimed at data journalists, museum curators, archivists, local gover
2222

2323
## News
2424

25+
* 1st July 2020: [Datasette 0.45](http://datasette.readthedocs.io/en/latest/changelog.html#v0-45) - [Magic parameters for canned queries](https://datasette.readthedocs.io/en/latest/sql_queries.html#canned-queries-magic-parameters), a log out feature, improved plugin documentation and four new plugin hooks.
2526
* 20th June 2020: [A cookiecutter template for writing Datasette plugins](https://simonwillison.net/2020/Jun/20/cookiecutter-plugins/)
2627
* 11th June 2020: [Datasette 0.44](http://datasette.readthedocs.io/en/latest/changelog.html#v0-44) - [Authentication and permissions](https://datasette.readthedocs.io/en/latest/authentication.html), [writable canned queries](https://datasette.readthedocs.io/en/latest/sql_queries.html#writable-canned-queries), flash messages, new plugin hooks and much, much more.
2728
* 28th May 2020: [Datasette 0.43](http://datasette.readthedocs.io/en/latest/changelog.html#v0-43) - Redesigned [register_output_renderer](https://datasette.readthedocs.io/en/latest/plugins.html#plugin-register-output-renderer) plugin hook and various small improvements and fixes.

‎docs/changelog.rst‎

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,61 @@
44
Changelog
55
=========
66

7-
.. _v0_45a5:
7+
.. _v0_45:
88

9-
0.45a5 (2020-06-30)
10-
-------------------
9+
0.45 (2020-07-01)
10+
-----------------
11+
12+
Magic parameters for canned queries, a log out feature, improved plugin documentation and four new plugin hooks.
13+
14+
Magic parameters for canned queries
15+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
17+
Canned queries now support :ref:`canned_queries_magic_parameters`, which can be used to insert or select automatically generated values. For example::
18+
19+
insert into logs
20+
(user_id, timestamp)
21+
values
22+
(:_actor_id, :_now_datetime_utc)
23+
24+
This inserts the currently authenticated actor ID and the current datetime. (`#842 <https://github.com/simonw/datasette/issues/842>`__)
1125

12-
.. warning:: This is an **alpha** release. See :ref:`contributing_alpha_beta`.
26+
Log out
27+
~~~~~~~
1328

14-
- Canned queries now support :ref:`canned_queries_magic_parameters`, which can be used to insert or select automatically generated values. For example::
29+
The :ref:`ds_actor cookie <authentication_ds_actor>` can be used by plugins (or by Datasette's :ref:`--root mechanism<authentication_root>`) to authenticate users. The new ``/-/logout`` page provides a way to clear that cookie.
1530

16-
insert into logs
17-
(user_id, timestamp)
18-
values
19-
(:_actor_id, :_now_datetime_utc)
31+
A "Log out" button now shows in the global navigation provided the user is authenticated using the ``ds_actor`` cookie. (`#840 <https://github.com/simonw/datasette/issues/840>`__)
32+
33+
Better plugin documentation
34+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
35+
36+
The plugin documentation has been re-arranged into four sections, including a brand new section on testing plugins. (`#687 <https://github.com/simonw/datasette/issues/687>`__)
37+
38+
- :ref:`plugins` introduces Datasette's plugin system and describes how to install and configure plugins.
39+
- :ref:`writing_plugins` describes how to author plugins, from simple one-off plugins to packaged plugins that can be published to PyPI. It also describes how to start a plugin using the new `datasette-plugin <https://github.com/simonw/datasette-plugin>`__ cookiecutter template.
40+
- :ref:`plugin_hooks` is a full list of detailed documentation for every Datasette plugin hook.
41+
- :ref:`testing_plugins` describes how to write tests for Datasette plugins, using `pytest <https://docs.pytest.org/>`__ and `HTTPX <https://www.python-httpx.org/>`__.
42+
43+
New plugin hooks
44+
~~~~~~~~~~~~~~~~
45+
46+
- :ref:`plugin_hook_register_magic_parameters` can be used to define new types of magic canned query parameters.
47+
- :ref:`plugin_hook_startup` can run custom code when Datasette first starts up. `datasette-init <https://github.com/simonw/datasette-init>`__ is a new plugin that uses this hook to create database tables and views on startup if they have not yet been created. (`#834 <https://github.com/simonw/datasette/issues/834>`__)
48+
- :ref:`plugin_hook_canned_queries` lets plugins provide additional canned queries beyond those defined in Datasette's metadata. See `datasette-saved-queries <https://github.com/simonw/datasette-saved-queries>`__ for an example of this hook in action. (`#852 <https://github.com/simonw/datasette/issues/852>`__)
49+
- :ref:`plugin_hook_forbidden` is a hook for customizing how Datasette responds to 403 forbidden errors. (`#812 <https://github.com/simonw/datasette/issues/812>`__)
50+
51+
Smaller changes
52+
~~~~~~~~~~~~~~~
2053

21-
This inserts the currently authenticated actor ID and the current datetime. (`#842 <https://github.com/simonw/datasette/issues/842>`__)
22-
- New ``/-/logout`` page, linked to from the navigation if you are logged in with a ``ds_actor`` cookie. (`#840 <https://github.com/simonw/datasette/issues/840>`__)
2354
- Cascading view permissons - so if a user has ``view-table`` they can view the table page even if they do not have ``view-database`` or ``view-instance``. (`#832 <https://github.com/simonw/datasette/issues/832>`__)
2455
- CSRF protection no longer applies to ``Authentication: Bearer token`` requests or requests without cookies. (`#835 <https://github.com/simonw/datasette/issues/835>`__)
25-
- New :ref:`plugin_hook_forbidden` plugin hook for customizing how Datasette responds to a 403 forbidden error. (`#812 <https://github.com/simonw/datasette/issues/812>`__)
26-
- New :ref:`plugin_hook_register_magic_parameters` plugin hook.
27-
- New :ref:`plugin_hook_startup` plugin hook. (`#834 <https://github.com/simonw/datasette/issues/834>`__)
28-
- New :ref:`plugin_hook_canned_queries` plugin hook. See `datasette-saved-queries <https://github.com/simonw/datasette-saved-queries>`__ for an example of this hook in action. (`#852 <https://github.com/simonw/datasette/issues/852>`__)
2956
- ``datasette.add_message()`` now works inside plugins. (`#864 <https://github.com/simonw/datasette/issues/864>`__)
3057
- Workaround for "Too many open files" error in test runs. (`#846 <https://github.com/simonw/datasette/issues/846>`__)
3158
- Respect existing ``scope["actor"]`` if already set by ASGI middleware. (`#854 <https://github.com/simonw/datasette/issues/854>`__)
3259
- New process for shipping :ref:`contributing_alpha_beta`. (`#807 <https://github.com/simonw/datasette/issues/807>`__)
33-
- Re-arranged plugins documentation into :ref:`plugins`, :ref:`writing_plugins`, :ref:`plugin_hooks` and a new section on :ref:`testing_plugins`. (`#687 <https://github.com/simonw/datasette/issues/687>`__)
3460
- ``{{ csrftoken() }}`` now works when plugins render a template using ``datasette.render_template(..., request=request)``. (`#863 <https://github.com/simonw/datasette/issues/863>`__)
61+
- Datasette now creates a single :ref:`internals_request` and uses it throughout the lifetime of the current HTTP request. (`#870 <https://github.com/simonw/datasette/issues/870>`__)
3562

3663
.. _v0_44:
3764

0 commit comments

Comments
 (0)