Admin¶
For instructions on how to use the models and mixins in this module, please refer to Admin integration.
-
class
import_export.admin.
ExportActionMixin
(*args, **kwargs)¶ Mixin with export functionality implemented as an admin action.
-
export_admin_action
(request, queryset)¶ Exports the selected rows using file_format.
-
-
class
import_export.admin.
ExportActionModelAdmin
(*args, **kwargs)¶ Subclass of ModelAdmin with export functionality implemented as an admin action.
-
class
import_export.admin.
ExportMixin
¶ Export mixin.
-
change_list_template
= 'admin/import_export/change_list_export.html'¶ template for change_list view
-
export_template_name
= 'admin/import_export/export.html'¶ template for export view
-
formats
= (<class 'import_export.formats.base_formats.CSV'>, <class 'import_export.formats.base_formats.XLS'>, <class 'import_export.formats.base_formats.XLSX'>, <class 'import_export.formats.base_formats.TSV'>, <class 'import_export.formats.base_formats.ODS'>, <class 'import_export.formats.base_formats.JSON'>, <class 'import_export.formats.base_formats.YAML'>, <class 'import_export.formats.base_formats.HTML'>)¶ available export formats
-
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.
-
has_export_permission
(request)¶ Returns whether a request has export permission.
-
resource_class
= None¶ resource class
-
to_encoding
= 'utf-8'¶ export data encoding
-
-
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.
-
change_list_template
= 'admin/import_export/change_list_import_export.html'¶ template for change_list view
-
-
class
import_export.admin.
ImportExportModelAdmin
(model, admin_site)¶ Subclass of ModelAdmin with import/export functionality.
-
class
import_export.admin.
ImportMixin
¶ Import mixin.
-
change_list_template
= 'admin/import_export/change_list_import.html'¶ template for change_list view
-
formats
= (<class 'import_export.formats.base_formats.CSV'>, <class 'import_export.formats.base_formats.XLS'>, <class 'import_export.formats.base_formats.XLSX'>, <class 'import_export.formats.base_formats.TSV'>, <class 'import_export.formats.base_formats.ODS'>, <class 'import_export.formats.base_formats.JSON'>, <class 'import_export.formats.base_formats.YAML'>, <class 'import_export.formats.base_formats.HTML'>)¶ available import formats
-
from_encoding
= 'utf-8'¶ import data encoding
-
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.
-
has_import_permission
(request)¶ Returns whether a request has import permission.
-
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.
-
import_template_name
= 'admin/import_export/import.html'¶ template for import view
-
process_import
(request, *args, **kwargs)¶ Perform the actual import action (after the user has confirmed the import)
-
resource_class
= None¶ resource class
-