mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
add actions but not work
This commit is contained in:
@@ -104,6 +104,9 @@ class AdminApp(FastAPI):
|
||||
sortable=name in sort_fields
|
||||
)
|
||||
}
|
||||
|
||||
fields['_actions'] = menu.actions
|
||||
|
||||
for data_field in data_fields:
|
||||
readonly = data_field.get('constraints').get('readOnly')
|
||||
field_type = data_field.get('field_type')
|
||||
|
||||
@@ -22,6 +22,11 @@ class Menu(BaseModel):
|
||||
sort_fields: Optional[Set[str]] = set()
|
||||
# define field type,like select,radiolist,text,date
|
||||
fields_type: Dict = {}
|
||||
actions: Dict = {
|
||||
'toolbar': {
|
||||
'delete_all': True
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
@@ -63,7 +68,7 @@ class Field(BaseModel):
|
||||
|
||||
class Resource(BaseModel):
|
||||
title: str
|
||||
resource_fields: Dict[str, Field]
|
||||
resource_fields: Dict[str, Union[Field, Dict]]
|
||||
searchFields: Optional[Dict[str, Field]]
|
||||
|
||||
class Config:
|
||||
|
||||
Reference in New Issue
Block a user