Piccolo

Latest version: v1.22.0

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

Scan your dependencies

Page 26 of 53

0.45.0

Not secure
------
Added the ``piccolo schema graph`` command for visualising your database
structure, which outputs a Graphviz file. It can then be turned into an
image, for example:

.. code-block:: bash

piccolo schema map | dot -Tpdf -o graph.pdf

Also made some minor changes to the ASGI templates, to reduce MyPy errors.

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

0.44.1

Not secure
------
Updated ``to_dict`` so it works with nested objects, as introduced by the
``prefetch`` functionality.

For example:

.. code-block:: python

band = Band.objects(Band.manager).first().run_sync()

>>> band.to_dict()
{'id': 1, 'name': 'Pythonistas', 'manager': {'id': 1, 'name': 'Guido'}}

It also works with filtering:

.. code-block:: python

>>> band.to_dict(Band.name, Band.manager.name)
{'name': 'Pythonistas', 'manager': {'name': 'Guido'}}

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

0.44.0

Not secure
------
Added the ability to prefetch related objects. Here's an example:

.. code-block:: python

band = await Band.objects(Band.manager).run()
>>> band.manager
<Manager: 1>

If a table has a lot of ``ForeignKey`` columns, there's a useful shortcut,
which will return all of the related rows as objects.

.. code-block:: python

concert = await Concert.objects(Concert.all_related()).run()
>>> concert.band_1
<Band: 1>
>>> concert.band_2
<Band: 2>
>>> concert.venue
<Venue: 1>

Thanks to wmshort for all the input.

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

0.43.0

Not secure
------
Migrations containing ``Array``, ``JSON`` and ``JSONB`` columns should be
more reliable now. More unit tests were added to cover edge cases.

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

0.42.0

Not secure
------
You can now use ``all_columns`` at the root. For example:

.. code-block:: python

await Band.select(
Band.all_columns(),
Band.manager.all_columns()
).run()

You can also exclude certain columns if you like:

.. code-block:: python

await Band.select(
Band.all_columns(exclude=[Band.id]),
Band.manager.all_columns(exclude=[Band.manager.id])
).run()

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

0.41.1

Not secure
------
Fix a regression where if multiple tables are created in a single migration
file, it could potentially fail by applying them in the wrong order.

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

Page 26 of 53

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.