Releases: piccolo-orm/piccolo_api
0.29.2
0.29.1
The __visible_fields
filter on PiccoloCRUD
now works on the detail endpoint (courtesy @sinisaos). For example:
GET /1/?__visible_fields=id,name,director.name
We also modified a type annotation in FastAPIWrapper
, so you can use it with FastAPI's APIRouter
without getting a type warning. Thanks to @gmos for reporting this issue.
0.29.0
Added a __visible_fields
filter to PiccoloCRUD
. It's a very powerful feature which lets us specify which fields we want the API to return from a GET request (courtesy @sinisaos).
It can even support joins, but we must supply a max_joins
parameter:
app = PiccoloCRUD(Movie, max_joins=1)
uvicorn(app)
Then we can do:
GET /?__visible_fields=id,name,director.name
Which will return:
{
"rows": [
{
"id": 17,
"name": "The Hobbit: The Battle of the Five Armies",
"director": {
"name": "Peter Jackson"
}
},
...
]
}
By specifying exactly which data we want returned, it is much more efficient, especially when fetching large numbers of rows, or with tables with lots of columns.
0.28.1
Fixed a bug with the delete endpoint of PiccoloCRUD
. It was returning a 204 response with a body (this isn't allowed, and could cause an exception to be raised in the web server). Thanks to @trondhindenes for reporting this issue.
Updated Swagger UI to the latest version.
0.28.0
Modified the get_ids
endpoint of PiccoloCRUD
, so it accepts an offset
query parameter. It already supported limit
.
0.27.0
You can now pass a schema_extra
argument to PiccoloCRUD
, which is added to the underlying Pydantic schema.
This is mostly to support new Piccolo Admin features.
0.26.0
create_pydantic_model
is now imported from the main Piccolo repo.
0.25.1
0.25.0
0.24.1
When using the nested
argument in create_pydantic_model
, more of the other arguments are passed to the nested models. For example, if include_default_columns
is True
, both the parent and child models will include their default columns.