Releases: piccolo-orm/piccolo_api
1.0a3
Using the new json_schema_extra
argument for create_pydantic_model
.
1.0a2
1.0a1
0.58.0
0.57.0
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
0.55.0
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
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
0.52.0
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