Skip to content

Releases: piccolo-orm/piccolo_admin

0.43.0

31 Jan 07:40
474e493
Compare
Choose a tag to compare

Added the link_column option to TableConfig.

By default, the primary key is used in the list view of Piccolo Admin to link to the edit page. Using link_column you can specify a different column (for example, if you hid the primary key using visible_columns).

For example, this is the default behaviour, using the primary key as the link:

Screenshot 2023-01-31 at 07 35 47

Using link_column and visible_columns we used the name column as the link instead:

studio_config = TableConfig(
    table_class=Studio,
    link_column=Studio.name,
    visible_columns=[Studio.name, Studio.facilities],
)

Screenshot 2023-01-31 at 07 36 26

Thanks to @sinisaos for helping with this.

0.42.0

26 Jan 17:08
0dbb344
Compare
Choose a tag to compare

Tables can now be grouped in the sidebar - this is helpful if you have lots of tables. To do this, use the menu_group argument of TableConfig. See the docs for more info.

Thanks to @sinisaos and @sumitsharansatsangi for their help with this.

Screenshot 2023-01-26 at 12 25 26

0.41.0

08 Jan 11:40
5924c4e
Compare
Choose a tag to compare

A fix to make Piccolo Admin work with fastapi>=0.89.0. Thanks to @sinisaos for this.

0.40.0

06 Jan 16:17
67509f2
Compare
Choose a tag to compare
  • Improved German translations (thanks to @hblunck for this).
  • When submitting a form, scroll to the top of the page if an error occurs so the error box is visible (thanks to @sinisaos for this).
  • If a custom BaseUser table is used for authentication, which uses a UUID as the primary key, it now works.

0.39.0

07 Dec 23:02
Compare
Choose a tag to compare

If an Array column has choices specified, then Piccolo Admin will show dropdowns, so the user can pick one of the choices.

206292810-23b47d29-ff7f-4d04-8c70-fd5c8d790629

Thanks to @sinisaos for help testing it.

0.38.0

18 Nov 22:48
Compare
Choose a tag to compare

Fixed a bug with TableConfig and exclude_visible_columns. Thanks to @web-maker for this fix.

0.37.0

16 Nov 17:21
Compare
Choose a tag to compare
  • Python 3.11 is now officially supported.
  • Added debug mode: create_admin(tables=[MyTable], debug=True).
  • Logging exceptions for 500 errors.
  • Fixed a typo in the docs about how to use validators (thanks to @sinisaos for reporting this).
  • Updated the tests for Starlette / FastAPI's new test client. This means that fastapi==0.87.0 / starlette==0.21.0 are now the minimum versions supported. Thanks to @sinisaos for this.

0.36.0

11 Nov 23:32
Compare
Choose a tag to compare

Lots of small enhancements.

  • Fixed bugs with the foreign key selector. Sometimes the edit button didn't work. Also, sometimes the value shown in the input box wasn't refreshing when navigating to a new page.
  • The HTML title now matches the site_name parameter in create_admin (thanks to @sinisaos for this).
  • Updated Vue to the latest version.
  • Internal code refactoring.

0.35.0

14 Oct 09:11
Compare
Choose a tag to compare

Validators can now be specified in TableConfig.

This allows fine grained access control - for example, only allowing some users to send POST requests to certain API endpoints:

from piccolo_api.crud.endpoints import PiccoloCRUD
from starlette.exceptions import HTTPException
from starlette.requests import Request


async def manager_only(
    piccolo_crud: PiccoloCRUD,
    request: Request
):
    # The Piccolo `BaseUser` can be accessed from the request.
    user = request.user.user

    # Assuming we have another database table where we record
    # users with certain permissions.
    manager = await Manager.exists().where(manager.user == user)

    if not manager:
        # Raise a Starlette exception if we want to reject the
        # request.
        raise HTTPException(
            status_code=403,
            detail="Only managers are allowed to do this"
        )


admin = create_admin(
    tables=TableConfig(
        Movie,
        validators=Validators(post_single=manager_only)
    )
)

0.34.0

11 Oct 22:07
Compare
Choose a tag to compare

Updated the date / datetime / time picker.