Skip to main content

Templates

The templates can be completely overridden and some of them are:
  • list_template: Template to use for list page. Default is fastdaisy_admin/list.html.
  • create_template: Template to use for creation page. Default is fastdaisy_admin/create.html.
  • edit_template: Template to use for edit page. Default is fastdaisy_admin/edit.html.

Events

There are four methods that you can use to do some actions before or after a model was created, updated or deleted.
  • on_model_change: Called before a model was created or updated.
  • after_model_change: Called after a model was created or updated.
  • on_model_delete: Called before a model was deleted.
  • after_model_delete: Called after a model was deleted.

Custom Action

The available options for an action include:
  • name: If not explicitly provided, the function name will be used as the action name which is displayed in the action dropdown on the list page.
Although there is a built-in export feature that allows users to export records in CSV or JSON format, the example below demonstrates how to create a custom action to export selected records.
In the above example, we created export_to_json function, It can be define anywhere which should contain three argument.
  • modelview: Instance of ModelView
  • request: It’s a HTTP request
  • objs: Selected objects of respective modelview