Piccolo

Latest version: v1.22.0

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

Scan your dependencies

Page 28 of 53

0.38.0

Not secure
------
``get_or_create`` now supports more complex where clauses. For example:

.. code-block:: python

row = await Band.objects().get_or_create(
(Band.name == 'Pythonistas') & (Band.popularity == 1000)
).run()

And you can find out whether the row was created or not using
``row._was_created``.

Thanks to wmshort for reporting this issue.

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

0.37.0

Not secure
------
Added ``ModelBuilder``, which can be used to generate data for tests (courtesy
aminalaee).

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

0.36.0

Not secure
------
Fixed an issue where ``like`` and ``ilike`` clauses required a wildcard. For
example:

.. code-block:: python

await Manager.select().where(Manager.name.ilike('Guido%')).run()

You can now omit wildcards if you like:

.. code-block:: python

await Manager.select().where(Manager.name.ilike('Guido')).run()

Which would match on ``'guido'`` and ``'Guido'``, but not ``'Guidoxyz'``.

Thanks to wmshort for reporting this issue.

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

0.35.0

Not secure
------
* Improved ``PrimaryKey`` deprecation warning (courtesy tonybaloney).
* Added ``piccolo schema generate`` which creates a Piccolo schema from an
existing database.
* Added ``piccolo tester run`` which is a wrapper around pytest, and
temporarily sets ``PICCOLO_CONF``, so a test database is used.
* Added the ``get`` convenience method (courtesy aminalaee). It returns the
first matching record, or ``None`` if there's no match. For example:

.. code-block:: python

manager = await Manager.objects().get(Manager.name == 'Guido').run()

This is equivalent to:
manager = await Manager.objects().where(Manager.name == 'Guido').first().run()

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

0.34.0

Not secure
------
Added the ``get_or_create`` convenience method (courtesy aminalaee). Example
usage:

.. code-block:: python

manager = await Manager.objects().get_or_create(
Manager.name == 'Guido'
).run()

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

0.33.1

Not secure
------
* Bug fix, where ``compare_dicts`` was failing in migrations if any ``Column``
had an unhashable type as an argument. For example: ``Array(default=[])``.
Thanks to hipertracker for reporting this problem.
* Increased the minimum version of orjson, so binaries are available for Macs
running on Apple silicon (courtesy hipertracker).

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

Page 28 of 53

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.