Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSuperiorStanislav committed Jan 20, 2025
1 parent c239876 commit 3c0a253
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Binary file added docs/_static/images/action-bands-openapi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,18 @@ the OpenAPI specification will be available.


Import/Export API actions mixins

.. figure:: _static/images/action-bands-openapi.png

A screenshot of the generated OpenAPI specification
-----------------

Alternatively you can use ``api.mixins.ExportStartActionMixin`` and ``api.mixins.ImportStartActionMixin``
to add to your current viewsets ability to create import/export jobs.
You would also need to use ``api.views.BaseExportJobViewSet/BaseExportJobForUsersViewSet``
and ``api.views.BaseExportJobViewSet/BaseImportJobForUsersViewSet`` to setup endpoints to be able to:
You would also need to use ``api.views.BaseExportJobViewSet`` or ``BaseExportJobForUsersViewSet``
and ``api.views.BaseImportJobViewSet`` or ``BaseImportJobForUsersViewSet`` to setup endpoints to be able to:

* ``list`` - Returns a list of jobs for the ``resource_class`` set in ViewSet
* ``retrieve`` - Returns details of a job based on the provided ID
* ``list`` - Returns a list of jobs for the ``resource_class`` set in ViewSet.
* ``retrieve`` - Returns details of a job based on the provided ID.
* ``cancel`` - Stops the import/export process and sets the job's status to ``CANCELLED``.
* ``confirm`` - Confirms the import after the parse stage. This action is available only in import jobs.
12 changes: 12 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ updated. This helps to increase the speed of import/export. The default value
is 100. This parameter can be specified separately for each resource by adding
``status_update_row_count`` to its ``Meta``.

``DRF_EXPORT_DJANGO_FILTERS_BACKEND``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Specifies filter backend class for ``django-filters`` in export action. Default:
``django_filters.rest_framework.DjangoFilterBackend``

``DRF_EXPORT_ORDERING_BACKEND``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Specifies filter backend class for ``ordering`` in export action. Default:
``rest_framework.filters.OrderingFilter``

Settings from django-import-export
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Additionally, the package supports settings from the original django-import-export package.
Expand Down

0 comments on commit 3c0a253

Please sign in to comment.