From 17e9448c987b0f320634f5c41e50ba2d1358573b Mon Sep 17 00:00:00 2001 From: Daniel Townsend Date: Sat, 23 Dec 2023 12:37:26 +0000 Subject: [PATCH] bumped version --- CHANGES.rst | 34 ++++++++++++++++++++++++++++++++++ piccolo/__init__.py | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3d257acc4..fcb9a8fe4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,40 @@ Changes ======= +1.2.0 +----- + +There's now an alternative syntax for joins, which works really well with +static type checkers like Mypy and Pylance. + +The traditional syntax (which continues to work as before): + +.. code-block:: python + + # Get the band name, and the manager's name from a related table + await Band.select(Band.name, Band.manager.name) + +The alternative syntax is as follows: + +.. code-block:: python + + await Band.select(Band.name, Band.manager._.name) + +Note how we use ``._.`` instead of ``.`` after a ``ForeignKey``. + +This offers a considerably better static typing experience. In the above +example, type checkers know that ``Band.manager._.name`` refers to the ``name`` +column on the ``Manager`` table. This means typos can be detected, and code +navigation is easier. + +Other changes +~~~~~~~~~~~~~ + +* Improve static typing for ``get_related``. +* Added support for the ``esmerald`` ASGI framework. + +------------------------------------------------------------------------------- + 1.1.1 ----- diff --git a/piccolo/__init__.py b/piccolo/__init__.py index 933b81888..55f78263a 100644 --- a/piccolo/__init__.py +++ b/piccolo/__init__.py @@ -1 +1 @@ -__VERSION__ = "1.1.1" +__VERSION__ = "1.2.0"