Skip to content

BaseFormAdmin

  • Form management base class

Inherit from base class

fields

schema

  • Form data model, must be set.

schema_init_out

  • Form initialization returns data model

schema_submit_out

  • Form submit returns data model

form

  • The current form amis Form object.
  • Reference: Form Form

form_path

  • Form submission and initialization data interface api routing path.

form_init

  • Whether to enable form data initialization. Default: None, not enabled.

route_init

  • Initialize form routing

route_submit

  • submit form routing

method

get_form

  • Get the current page Form object.
async def get_form(self, request: Request) -> Form

get_form_item

async def get_form_item(self, request: Request, 
                  modelfield: ModelField) -> Union[FormItem, SchemaNode]

FormAdmin

  • Form management

Inherit from base class

method

handle

Handle page form submission data.

  • request: The current request object.
  • data: The form data model schema instance object submitted by the user.
async def handle(self, request: Request, data: BaseModel, **kwargs) -> BaseApiOut[Any]

get_init_data

Get page form initialization data.

async def get_init_data(self, request: Request, **kwargs) -> BaseApiOut[Any]