List page
Various options that allow configuration in list page are:column_list: List of columns or column names to be displayed in the list page.column_exclude_list: List of columns or column names to be excluded in the list page.column_display_link: List of columns or column names that allow to navigate in edit pagecolumn_formatters: Dictionary of column formatters in the list page.column_searchable_list: List of columns or column names to be searchable in the list page.column_sortable_list: List of columns or column names to be sortable in the list page.column_default_sort: Default sorting if no sorting is applied, tuple of (column, is_descending) or list of the tuple for multiple columns.column_filters: List of columns or column names to be filterable in the list page.list_per_page: Number of items to be display in list page. Default value is10.list_query: A method to customize the list query.count_query: A method to customize the count query.search_query: A method to customize the search query.details_query: A method to customize the details query.
You can use the special keyword
__all__ in column_list
if you don’t want to specify all the columns manually. For example: column_list = __all__Forms
Form customization with your models. The forms are based onWTForms package and include the following options:
form: Default form to be used for creating or editing the model. Default value is None and form is created dynamically.form_base_class: Default base class for creating forms. Default value iswtforms.Form.form_args: Dictionary of form field arguments supported by WTForms.form_widget_args: Dictionary of form widget rendering arguments supported by WTForms.form_columns: List of model columns to be included in the form. Default is all model columns.form_excluded_columns: List of model columns to be excluded from the form.form_overrides: Dictionary of form fields to override when creating the form.form_converter: Allow adding custom converters to support additional column types.form_edit_query: A method to customize the edit form data.form_rules: List of form rules to manage rendering and behaviour of form.form_create_rules: List of form rules to manage rendering and behaviour of form in create page.form_edit_rules: List of form rules to manage rendering and behaviour of form in edit page.
Export and General options
There are few options which applied to bothList or Edit page.
column_labels: A mapping of column labels, used to map column names to new names in all places.save_as: A boolean to enable “save as new” option when editing an object.save_as_continue: A boolean to control the redirect URL if save_as is enabled.can_export: If the model can be exported. Default value is True.column_export_list: List of columns to include in the export data. Default is all.column_export_exclude_list: List of columns to exclude in the export data.export_max_rows: Maximum number of rows to be exported. Default value is 0 which means unlimited.export_types: List of export types to be enabled. Default value is [“csv”,“json”].
Built in Column Filters
Different filters are available which get implemented automatically based on model fieldsfor_eg: column_filters = [User.name, "is_admin"].
All filters have a default value of “all” which allows the user to display all records.
BooleanFilter- A filter for boolean columns, with the values of Yes (true) and No (false)AllUniqueStringValuesFilter- A filter for string columns, with the values of all unique values in the columnEnumFilter- A filter for enum columns which uses the values defined in the corresponding Enum class for filtering optionsDateFieldFilter- A filter for Date and DateTime columns. It supports relative filter options such asToday,Past 7 DaysandThis Yearand also supports __isnull suffix to filter rows where the date field is NULLForeignKeyFilter- A filter for relationship column which allows filtering based on values from the related model associated with the foreign key relationship
column_filters. The appropriate filter class is automatically applied based on the column type.