Piccolo-api

Latest version: v1.4.0

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 10 of 21

0.25.0

------

If you send a GET request to the ``session_logout`` endpoint, it will now
render a simple logout form. This makes it work much nicer out of the box.
Thanks to sinisaos for adding this.

-------------------------------------------------------------------------------

0.24.1

------

When using the ``nested` argument in ``create_pydantic_model``, more of the
other arguments are passed to the nested models. For example, if
``include_default_columns`` is ``True``, both the parent and child models will
include their default columns.

-------------------------------------------------------------------------------

0.24.0

------

Added support for nested models in ``create_pydantic_model``. For each
``ForeignKey`` in the Piccolo table, the Pydantic model will contain a sub
model for the related table.

For example:

.. code-block::

class Manager(Table):
name = Varchar()

class Band(Table):
name = Varchar()
manager = ForeignKey(Manager)

BandModel = create_pydantic_model(Band, nested=True)

If we were to write ``BandModel`` by hand instead, it would look like this:

.. code-block::

class ManagerModel(BaseModel):
name: str

class BandModel(BaseModel):
name: str
manager: ManagerModel

This feature is designed to work with the new ``nested`` output option in
Piccolo >= 0.40.0, which returns the data in the correct format to pass
directly to the nested Pydantic model.

.. code-block::

band = Band.select(
Band.id,
Band.name,
*Band.manager.all_columns()
).first(
).output(
nested=True
).run_sync()
>>> print(band)
{'id': 1, 'name': 'Pythonistas', 'manager': {'id': 1, 'name': 'Guido'}}

BandModel(**band)

Courtesy aminalaee.

-------------------------------------------------------------------------------

0.23.1

------

Make sure ``asyncpg`` gets installed, as Piccolo API currently has a hard
requirement on it (we hope to fix this in the future).

-------------------------------------------------------------------------------

0.23.0

------

* Fixed MyPy errors (courtesy sinisaos).
* Simplification of JWT authentication - it no longer needlessly checks
expiry, as PyJWT already does this (courtesy aminalaee).
* Substantial increase in code coverage (courtesy aminalaee and sinisaos).
* Increased the minimum PyJWT version, as versions > 2.0.0 return the JWT as a
string instead of bytes.
* Added an option to exclude columns when using ``create_pydantic_model``
(courtesy kucera-lukas).

-------------------------------------------------------------------------------

0.22.0

------

Updating ``PiccoloCRUD`` so it works better with the custom primary key feature
added in Piccolo.

-------------------------------------------------------------------------------

Page 10 of 21

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.