Admin

For instructions on how to use the models and mixins in this module, please refer to Admin integration.

class import_export.admin.ExportActionModelAdmin(*args, **kwargs)

Subclass of ModelAdmin with export functionality implemented as an admin action.

export_admin_action(request, queryset)

Exports the selected rows using file_format.

class import_export.admin.ExportMixin

Export mixin.

get_export_data(file_format, queryset, *args, **kwargs)

Returns file_format representation for given queryset.

get_export_formats()

Returns available export formats.

get_export_queryset(request)

Returns export queryset.

Default implementation respects applied search and filters.

get_export_resource_class()

Returns ResourceClass to use for export.

class import_export.admin.ImportExportActionModelAdmin(*args, **kwargs)

Subclass of ExportActionModelAdmin with import/export functionality. Export functionality is implemented as an admin action.

class import_export.admin.ImportExportMixin

Import and export mixin.

class import_export.admin.ImportExportModelAdmin(model, admin_site)

Subclass of ModelAdmin with import/export functionality.

class import_export.admin.ImportMixin

Import mixin.

get_import_form()

Get the form type used to read the import format and file.

get_import_formats()

Returns available import formats.

get_import_resource_class()

Returns ResourceClass to use for import.

import_action(request, *args, **kwargs)

Perform a dry_run of the import to make sure the import will not result in errors. If there where no error, save the user uploaded file to a local temp file that will be used by ‘process_import’ for the actual import.

process_import(*args, **kwargs)

Perform the actual import action (after the user has confirmed the import)