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.


Returns available export formats.


Returns export queryset.

Default implementation respects applied search and filters.


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 the form type used to read the import format and file.


Returns available import formats.


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)