API (Rest Framework)

class import_export_extensions.api.views.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_detail_serializer_class()

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

get_import_create_serializer_class()

Get serializer which will be used to start import job.

get_queryset()

Filter import jobs by resource used in viewset.

get_resource_kwargs() dict[str, Any]

Provide extra arguments to resource class.

get_serializer(*args, **kwargs)

Provide resource kwargs to serializer class.

get_serializer_class()

Return special serializer on creation.

serializer_class

alias of ImportJobSerializer

start(request, *args, **kwargs)

Validate request data and start ImportJob.

class import_export_extensions.api.views.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)

Cancel export job that is in progress.

get_detail_serializer_class()

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

get_export_create_serializer_class()

Get serializer which will be used to start export job.

get_queryset()

Filter export jobs by resource used in viewset.

get_resource_kwargs() dict[str, Any]

Provide extra arguments to resource class.

get_serializer(*args, **kwargs)

Provide resource kwargs to serializer class.

get_serializer_class()

Return special serializer on creation.

serializer_class

alias of ExportJobSerializer

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 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