add annotation and update README.rst

This commit is contained in:
long2ice
2020-04-13 16:42:03 +08:00
parent 71ca35a07a
commit 4ebd2f80df
2 changed files with 6 additions and 4 deletions

View File

@@ -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/<action>
)
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.
}
]
),

View File

@@ -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/<Model> 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]]