API (Rest Framework)

class import_export_extensions.api.ImportJobViewSet(**kwargs)

Base API viewset for ImportJob model.

Based on resource_class it will generate an endpoint which will allow to start an import to model which was specified in resource_class. On success this endpoint we return an instance of import.

Endpoints:

list - to get list of all import jobs details(retrieve) - to get status of import job start - create import job and start parsing data from attached file confirm - confirm import after parsing process is finished cancel - stop importing/parsing process and cancel this import job

cancel(*args, **kwargs)

Cancel import job that is in progress.

confirm(*args, **kwargs)

Confirm import job that has parsed status.

get_queryset()

Filter import jobs by resource used in viewset.

class import_export_extensions.api.ExportJobViewSet(**kwargs)

Base API viewset for ExportJob model.

Based on resource_class it will generate an endpoint which will allow to start an export of model which was specified in resource_class. This endpoint will support filtration based on FilterSet class specified in resource. On success this endpoint we return an instance of export, to get status of job, just use detail(retrieve) endpoint.

cancel(*args, **kwargs) Response

Cancel export job that is in progress.

get_queryset()

Filter export jobs by resource used in viewset.

class import_export_extensions.api.ImportJobForUserViewSet(**kwargs)

Viewset for providing import feature to users.

cancel(*args, **kwargs)

Cancel import job that is in progress.

confirm(*args, **kwargs)

Confirm import job that has parsed status.

class import_export_extensions.api.ExportJobForUserViewSet(**kwargs)

Viewset for providing export feature to users.

cancel(*args, **kwargs) Response

Cancel export job that is in progress.

class import_export_extensions.api.BaseImportJobViewSet(**kwargs)

Base viewset for managing import jobs.

cancel(*args, **kwargs)

Cancel import job that is in progress.

confirm(*args, **kwargs)

Confirm import job that has parsed status.

serializer_class

alias of ImportJobSerializer

class import_export_extensions.api.BaseExportJobViewSet(**kwargs)

Base viewset for managing export jobs.

cancel(*args, **kwargs) Response

Cancel export job that is in progress.

serializer_class

alias of ExportJobSerializer

class import_export_extensions.api.BaseImportJobForUserViewSet(**kwargs)

Viewset for providing export job management to users.

cancel(*args, **kwargs)

Cancel import job that is in progress.

confirm(*args, **kwargs)

Confirm import job that has parsed status.

class import_export_extensions.api.BaseExportJobForUserViewSet(**kwargs)

Viewset for providing export job management to users.

cancel(*args, **kwargs) Response

Cancel export job that is in progress.

class import_export_extensions.api.LimitQuerySetToCurrentUserMixin

Make queryset to return only current user jobs.

get_queryset()

Return user’s jobs.

class import_export_extensions.api.ImportStartActionMixin

Mixin which adds start import action.

get_import_create_serializer_class()

Get serializer which will be used to start import job.

get_import_detail_serializer_class()

Get serializer which will be used show details of import job.

get_import_resource_kwargs() dict[str, Any]

Provide extra arguments to resource class.

get_queryset()

Return import model queryset on import action.

For better openapi support and consistency.

get_serializer(*args, **kwargs)

Provide resource kwargs to serializer class.

import_detail_serializer_class

alias of ImportJobSerializer

start_import(request: Request) Response

Validate request data and start ImportJob.

class import_export_extensions.api.ExportStartActionMixin

Mixin which adds start export action.

export_detail_serializer_class

alias of ExportJobSerializer

get_export_create_serializer_class()

Get serializer which will be used to start export job.

get_export_detail_serializer_class()

Get serializer which will be used show details of export job.

get_export_resource_kwargs() dict[str, Any]

Provide extra arguments to resource class.

get_queryset()

Return export model queryset on export action.

For better openapi support and consistency.

get_serializer(*args, **kwargs)

Provide resource kwargs to serializer class.

start_export(request: Request) Response

Validate request data and start ExportJob.

class import_export_extensions.api.CreateExportJob(*args, **kwargs)

Base Serializer to start export job.

It used to set up base workflow of ExportJob creation via API.

create(validated_data: dict[str, Any]) ExportJob

Create export job.

validate(attrs: dict[str, Any]) dict[str, Any]

Check that ordering and filter kwargs are valid.

class import_export_extensions.api.CreateImportJob(*args, **kwargs)

Base Serializer to start import job.

It used to set up base workflow of ImportJob creation via API.

create(validated_data: dict[str, Any]) ImportJob

Create import job.

class import_export_extensions.api.ExportJobSerializer(*args, **kwargs)

Serializer to show information about export job.

class import_export_extensions.api.ImportJobSerializer(*args, **kwargs)

Serializer to show information about import job.

class import_export_extensions.api.ProgressSerializer(*args, **kwargs)

Serializer to show progress of job.

info: ProgressInfoSerializer = {"current": 0, "total": 0}

Shows current and total imported/exported values

class import_export_extensions.api.ProgressInfoSerializer(*args, **kwargs)

Serializer to show progress info, like how much is done.

current: int = 0

Shows number of imported/exported objects

total: int = 0

Shows total objects to import/export