Skip to content

Releases: piccolo-orm/piccolo_api

1.0a3

19 Oct 16:59
Compare
Choose a tag to compare
1.0a3 Pre-release
Pre-release

Using the new json_schema_extra argument for create_pydantic_model.

1.0a2

06 Sep 17:24
Compare
Choose a tag to compare
1.0a2 Pre-release
Pre-release

Fixed a bug with extracting the type from an optional type. Thanks to @sinisaos for discovering this issue.

1.0a1

04 Sep 13:10
Compare
Choose a tag to compare
1.0a1 Pre-release
Pre-release

Pydantic v2 support - many thanks to @sinisaos for this.

0.58.0

02 Aug 20:33
Compare
Choose a tag to compare

Upgraded the version of Swagger UI used in the swagger_ui endpoint (see piccolo_api.openapi.endpoints.swagger_ui). Thanks to @sinisaos for this.

0.57.0

24 Jul 18:05
Compare
Choose a tag to compare

PiccoloCRUD now handles foreign key violation errors gracefully.

For example, if we have tables like this:

class Director(Table):
    name = Varchar()

class Movie(Table):
    name = Varchar()
    director = ForeignKey(Director, on_delete=OnDelete.restrict)

The ON DELETE RESTRICT constraint means we're not allowed to delete a director if a movie has a foreign key to it.

We now get a 422 error response, with an error message which we can display in Piccolo Admin.

Support for Python 3.7 has also been dropped, as it's end of life.

0.56.0

07 Jul 21:22
Compare
Choose a tag to compare

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.55.0

13 May 17:17
Compare
Choose a tag to compare

Added the excluded_paths argument to TokenAuthBackend. This means you can wrap an entire ASGI application in this middleware, and exclude certain paths, such as the Swagger docs. Thanks to @sinisaos for this.

app = FastAPI(
    dependencies=[Depends(APIKeyHeader(name="Authorization"))],
    middleware=[
        Middleware(
            AuthenticationMiddleware,
            backend=TokenAuthBackend(
                SecretTokenAuthProvider(tokens=["abc123"]),
                excluded_paths=["/docs", "/openapi.json"],  # <- Note
            ),
        )
    ],
)

0.54.0

07 Apr 20:06
Compare
Choose a tag to compare

Added allow_unauthenticated option to JWTMiddleware.

By default, JWTMiddleware rejects any request with an invalid JWT token, but with this option we allow the user to reject the request instead within their endpoints.

0.53.0

03 Apr 22:39
Compare
Choose a tag to compare

Added token_login endpoint, which is more convenient than TokenAuthLoginEndpoint.

Improved the docs for token auth and JWT auth (thanks to @sinisaos).

Modified the OrderBy class, to add some functionality needed by Piccolo Admin.

0.52.0

17 Mar 14:27
Compare
Choose a tag to compare

PiccoloCRUD now lets you specify multiple columns in the __order GET param.

For example, with this schema:

class Movie(Table):
    name = Varchar()
    rating = Integer()

To order the results by descending rating and ascending name:

GET /?__order=-rating,name