Piccolo

Latest version: v1.22.0

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

Scan your dependencies

Page 14 of 53

0.89.0

Not secure
------

Made it easier to access the ``Email`` columns on a table.

.. code-block:: python

>>> MyTable._meta.email_columns
[MyTable.email_column_1, MyTable.email_column_2]

This was added for Piccolo Admin.

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

0.88.0

Not secure
------

Fixed a bug with migrations - when using ``db_column_name`` it wasn't being
used in some alter statements. Thanks to theelderbeever for reporting this
issue.

.. code-block:: python

class Concert(Table):
We use `db_column_name` when the column name is problematic - e.g. if
it clashes with a Python keyword.
in_ = Varchar(db_column_name='in')

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

0.87.0

Not secure
------

When using ``get_or_create`` with ``prefetch`` the behaviour was inconsistent -
it worked as expected when the row already existed, but prefetch wasn't working
if the row was being created. This now works as expected:

.. code-block:: python

>>> band = Band.objects(Band.manager).get_or_create(
... (Band.name == "New Band 2") & (Band.manager == 1)
... )

>>> band.manager
<Manager: 1>
>>> band.manager.name
"Mr Manager"

Thanks to backwardspy for reporting this issue.

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

0.86.0

Not secure
------

Added the ``Email`` column type. It's basically identical to ``Varchar``,
except that when we use ``create_pydantic_model`` we add email validation
to the generated Pydantic model.

.. code-block:: python

from piccolo.columns.column_types import Email
from piccolo.table import Table
from piccolo.utils.pydantic import create_pydantic_model


class MyTable(Table):
email = Email()


model = create_pydantic_model(MyTable)

model(email="not a valid email")
ValidationError!

Thanks to sinisaos for implementing this feature.

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

0.85.1

Not secure
------

Fixed a bug with migrations - when run backwards, ``raw`` was being called
instead of ``raw_backwards``. Thanks to translunar for the fix.

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

0.85.0

Not secure
------

You can now append items to an array in an update query:

.. code-block:: python

await Ticket.update({
Ticket.seat_numbers: Ticket.seat_numbers + [1000]
}).where(Ticket.id == 1)

Currently Postgres only. Thanks to sumitsharansatsangi for suggesting this
feature.

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

Page 14 of 53

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.