Releases: piccolo-orm/piccolo_api
0.34.0
0.33.1
Fixing the ids
endpoint of PiccoloCRUD
when a custom primary key column is used with a name other than id
.
0.33.0
The schema endpoint of PiccoloCRUD
now returns the primary key name. This means we'll be able to support tables with a custom primary key name in Piccolo Admin.
0.32.3
Make sure tables with a custom primary key column work with PiccoloCRUD
.
0.32.2
Fixed a bug with PiccoloCRUD
, where a PATCH request returned a string instead of a JSON object. Thanks to @trondhindenes for discovering and fixing this issue.
0.32.1
Fixed bug with __range_header=false
.
0.32.0
Added support for the Content-Range
HTTP header in the GET endpoint of PiccoloCRUD
. This means the API client can fetch the number of available rows, without doing a separate API call to the count
endpoint.
GET /?__range_header=true
If the page size is 10, then the response header looks something like:
Content-Range: movie 0-9/100
The feature was created to make Piccolo APIs work better with front ends like React Admin.
Thanks to @trondhindenes for adding this feature, and @sinisaos for help reviewing.
0.31.0
Added hooks to PiccoloCRUD
. This allows the user to add their own logic before a save / patch / delete (courtesy @trondhindenes).
For example:
# Normal functions and async functions are supported:
def pre_save_hook(movie):
movie.rating = 90
return movie
PiccoloCRUD(
table=Movie,
read_only=False,
hooks=[
Hook(hook_type=HookType.pre_save, callable=pre_save_hook)
]
)
0.30.1
0.30.0
We recently added the __visible_fields
GET parameter to PiccoloCRUD
, which allows the user to determine which fields are returned by the API.
GET /?__visible_fields=id,name
However, there was no way of the user knowing which fields were supported. This is now possible by visiting the /schema
endpoint, which has a visible_fields_options
field which lists the columns available on the table and related tables (courtesy @sinisaos).