Piccolo

Latest version: v1.22.0

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

Scan your dependencies

Page 27 of 53

0.41.0

Not secure
------
Fixed a bug where if ``all_columns`` was used two or more levels deep, it would
fail. Thanks to wmshort for reporting this issue.

Here's an example:

.. code-block:: python

Concert.select(
Concert.venue.name,
*Concert.band_1.manager.all_columns()
).run_sync()

Also, the ``ColumnsDelegate`` has now been tweaked, so unpacking of
``all_columns`` is optional.

.. code-block:: python

This now works the same as the code above (we have omitted the *)
Concert.select(
Concert.venue.name,
Concert.band_1.manager.all_columns()
).run_sync()

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

0.40.1

Not secure
------
Loosen the ``typing-extensions`` requirement, as it was causing issues when
installing ``asyncpg``.

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

0.40.0

Not secure
------
Added ``nested`` output option, which makes the response from a ``select``
query use nested dictionaries:

.. code-block:: python

>>> await Band.select(Band.name, *Band.manager.all_columns()).output(nested=True).run()
[{'name': 'Pythonistas', 'manager': {'id': 1, 'name': 'Guido'}}]

Thanks to wmshort for the idea.

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

0.39.0

Not secure
------
Added ``to_dict`` method to ``Table``.

If you just use ``__dict__`` on a ``Table`` instance, you get some non-column
values. By using ``to_dict`` it's just the column values. Here's an example:

.. code-block:: python

class MyTable(Table):
name = Varchar()

instance = MyTable.objects().first().run_sync()

>>> instance.__dict__
{'_exists_in_db': True, 'id': 1, 'name': 'foo'}

>>> instance.to_dict()
{'id': 1, 'name': 'foo'}

Thanks to wmshort for the idea, and aminalaee and sinisaos for investigating
edge cases.

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

0.38.2

Not secure
------
Removed problematic type hint which assumed pytest was installed.

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

0.38.1

Not secure
------
Minor changes to ``get_or_create`` to make sure it handles joins correctly.

.. code-block:: python

instance = (
Band.objects()
.get_or_create(
(Band.name == "My new band")
& (Band.manager.name == "Excellent manager")
)
.run_sync()
)

In this situation, there are two columns called ``name`` - we need to make sure
the correct value is applied if the row doesn't exist.

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

Page 27 of 53

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.