Piccolo

Latest version: v1.5.0

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

Scan your dependencies

Page 17 of 48

0.63.0

Not secure
------

Added an ``exclude_imported`` option to ``table_finder``.

.. code-block:: python

APP_CONFIG = AppConfig(
table_classes=table_finder(['music.tables'], exclude_imported=True)
)

It's useful when we want to import ``Table`` subclasses defined within a
module itself, but not imported ones:

.. code-block:: python

tables.py
from piccolo.apps.user.tables import BaseUser excluded
from piccolo.columns.column_types import ForeignKey, Varchar
from piccolo.table import Table


class Musician(Table): included
name = Varchar()
user = ForeignKey(BaseUser)

This was also possible using tags, but was less convenient. Thanks to sinisaos
for reporting this issue.

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

0.62.3

Not secure
------

Fixed the error message in ``LazyTableReference``.

Fixed a bug with ``create_pydantic_model`` with nested models. For example:

.. code-block:: python

create_pydantic_model(Band, nested=(Band.manager,))

Sometimes Pydantic couldn't uniquely identify the nested models. Thanks to
wmshort and sinisaos for their help with this.

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

0.62.2

Not secure
------

Added a max password length to the ``BaseUser`` table. By default it's set to
128 characters.

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

0.62.1

Not secure
------

Fixed a bug with ``Readable`` when it contains lots of joins.

``Readable`` is used to create a user friendly representation of a row in
Piccolo Admin.

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

0.62.0

Not secure
------

Added Many-To-Many support.

.. code-block:: python

from piccolo.columns.column_types import (
ForeignKey,
LazyTableReference,
Varchar
)
from piccolo.columns.m2m import M2M


class Band(Table):
name = Varchar()
genres = M2M(LazyTableReference("GenreToBand", module_path=__name__))


class Genre(Table):
name = Varchar()
bands = M2M(LazyTableReference("GenreToBand", module_path=__name__))


This is our joining table:
class GenreToBand(Table):
band = ForeignKey(Band)
genre = ForeignKey(Genre)


>>> await Band.select(Band.name, Band.genres(Genre.name, as_list=True))
[
{
"name": "Pythonistas",
"genres": ["Rock", "Folk"]
},
...
]

See the docs for more details.

Many thanks to sinisaos and yezz123 for all the input.

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

0.61.2

Not secure
------

Fixed some edge cases where migrations would fail if a column name clashed with
a reserved Postgres keyword (for example ``order`` or ``select``).

We now have more robust tests for ``piccolo asgi new`` - as part of our CI we
actually run the generated ASGI app to make sure it works (thanks to AliSayyah
and yezz123 for their help with this).

We also improved docstrings across the project.

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

Page 17 of 48

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.