Skip to content

Releases: piccolo-orm/piccolo_api

0.34.0

03 Jun 20:45
Compare
Choose a tag to compare

Added a register endpoint, which is great for quickly prototyping a sign up process (courtesy @sinisaos).

Added hooks to the session_login endpoint, allowing additional logic to be triggered before and after login.

0.33.1

12 Jan 21:12
Compare
Choose a tag to compare

Fixing the ids endpoint of PiccoloCRUD when a custom primary key column is used with a name other than id.

0.33.0

12 Jan 08:06
Compare
Choose a tag to compare

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

11 Jan 20:01
Compare
Choose a tag to compare

Make sure tables with a custom primary key column work with PiccoloCRUD.

0.32.2

03 Jan 22:30
Compare
Choose a tag to compare

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

02 Jan 20:03
Compare
Choose a tag to compare

Fixed bug with __range_header=false.

0.32.0

02 Jan 18:11
Compare
Choose a tag to compare

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

30 Dec 15:03
Compare
Choose a tag to compare

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

13 Dec 19:46
Compare
Choose a tag to compare
  • Streamlined the CSRFMiddleware code, and added missing type annotations.
  • If using the __visible_fields parameter with PiccoloCRUD, and the field name is unrecognised, the error response will list the correct field names.
  • Improved test coverage (courtesy @sinisaos).

0.30.0

09 Dec 22:38
Compare
Choose a tag to compare

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