diff --git a/README.rst b/README.rst index dc46551..7a2dc3f 100644 --- a/README.rst +++ b/README.rst @@ -81,7 +81,7 @@ Only you should do is runing a fastapi app and mount admin app from fastapi-admi @admin_app.post( - '/{resource}/bulk/test_bulk' + '/{resource}/bulk/test_bulk' # must be format with /{resource}/bulk/ ) async def test_bulk( bulk_in: BulkIn, @@ -132,8 +132,8 @@ Only you should do is runing a fastapi app and mount admin app from fastapi-admi 'text': 'delete_all', } , { - 'value': 'test_bulk', - 'text': 'TestBulk' + 'value': 'test_bulk', # this is the action need in fastapi route. + 'text': 'TestBulk' # will show in front. } ] ), diff --git a/fastapi_admin/site.py b/fastapi_admin/site.py index b92b0c9..a80084f 100644 --- a/fastapi_admin/site.py +++ b/fastapi_admin/site.py @@ -5,10 +5,12 @@ from pydantic import BaseModel, HttpUrl class Menu(BaseModel): name: str + # whether is it a title or a model resource. title: Optional[bool] + # must be format with /rest/ if it's a model resource. url: Optional[str] icon: Optional[str] - # children meun + # children menu children: Optional[List['Menu']] = [] # include fields include: Optional[Tuple[str]]