Piccolo

Latest version: v1.5.0

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

Scan your dependencies

Page 4 of 48

0.121.0

Not secure
-------

Modified the ``BaseUser.login`` logic so all code paths take the same time.
Thanks to Skelmis for this.

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

0.120.0

Not secure
-------

Improved how ``ModelBuilder`` generates JSON data.

The number of password hash iterations used in ``BaseUser`` has been increased
to keep pace with the latest guidance from OWASP - thanks to Skelmis for this.

Fixed a bug with auto migrations when the table is in a schema.

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

0.119.0

Not secure
-------

``ModelBuilder`` now works with ``LazyTableReference`` (which is used when we
have circular references caused by a ``ForeignKey``).

With this table:

.. code-block:: python

class Band(Table):
manager = ForeignKey(
LazyTableReference(
'Manager',
module_path='some.other.folder.tables'
)
)

We can now create a dynamic test fixture:

.. code-block:: python

my_model = await ModelBuilder.build(Band)

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

0.118.0

Not secure
-------

If you have lots of Piccolo apps, you can now create auto migrations for them
all in one go:

.. code-block:: bash

piccolo migrations new all --auto

Thanks to hoosnick for suggesting this new feature.

The documentation for running migrations has also been improved, as well as
improvements to the sorting of migrations based on their dependencies.

Support for Python 3.7 was dropped in this release as it's now end of life.

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

0.117.0

Not secure
-------

Version pinning Pydantic to v1, as v2 has breaking changes.

We will add support for Pydantic v2 in a future release.

Thanks to sinisaos for helping with this.

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

0.116.0

Not secure
-------

Fixture formatting
~~~~~~~~~~~~~~~~~~

When creating a fixture:

.. code-block:: bash

piccolo fixtures dump

The JSON output is now nicely formatted, which is useful because we can pipe
it straight to a file, and commit it to Git without having to manually run a
formatter on it.

.. code-block:: bash

piccolo fixtures dump > my_fixture.json

Thanks to sinisaos for this.

Protected table names
~~~~~~~~~~~~~~~~~~~~~

We used to raise a ``ValueError`` if a table was called ``user``.

.. code-block:: python

class User(Table): ValueError!
...

It's because ``user`` is already used by Postgres (e.g. try ``SELECT user`` or
``SELECT * FROM user``).

We now emit a warning instead for these reasons:

* Piccolo wraps table names in quotes to avoid clashes with reserved keywords.
* Sometimes you're stuck with a table name from a pre-existing schema, and
can't easily rename it.

Re-export ``WhereRaw``
~~~~~~~~~~~~~~~~~~~~~~

If you want to write raw SQL in your where queries you use ``WhereRaw``:

.. code-block:: python

>>> Band.select().where(WhereRaw('TRIM(name) = {}', 'Pythonistas'))

You can now import it from ``piccolo.query`` to be consistent with
``SelectRaw`` and ``OrderByRaw``.

.. code-block:: python

from piccolo.query import WhereRaw

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

Page 4 of 48

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.