Skip to content

Commit

Permalink
Merge branch 'selectable-export-fields' of https://github.com/cocoroc…
Browse files Browse the repository at this point in the history
…ho/django-import-export into selectable-export-fields
  • Loading branch information
cocorocho committed Jan 11, 2024
2 parents d8bd1d8 + bf45f8f commit d52fc91
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Binary file modified docs/_static/images/django-import-export-export-confirm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/admin_integration.rst
Expand Up @@ -37,7 +37,7 @@ dropdown in the UI.
.. figure:: _static/images/django-import-export-change.png

A screenshot of the change view with Import and Export buttons.

Importing
---------

Expand Down Expand Up @@ -154,7 +154,7 @@ Enabling export functionality means that a UI button will automatically be prese
When clicked, the user will be directed into the export workflow.

Export is a two step process. When the 'export' button is clicked, the user will be directed to a new screen,
where 'resource' and 'file format' can be selected.
where 'fields', 'resource' and 'file format' can be selected.

.. _export_confirm:

Expand Down
10 changes: 10 additions & 0 deletions docs/release_notes.rst
Expand Up @@ -91,6 +91,16 @@ selected items using an export admin action. However this meant that the export
possible to select the export resource. This has been fixed in v4 so that export workflow is now present when
exporting via the Admin UI action. For more information see :ref:`export documentation<export_via_admin_action>`.

Export selected fields
----------------------

The :ref:`export 'confirm' page<export_confirm>` now includes selectable fields for export.
If you wish to revert to the previous (v3) version of the export confirm screen, add a
:attr:`~import_export.admin.ExportMixin.export_form_class` declaration to your Admin class subclass, for example::

class BookAdmin(ImportExportModelAdmin):
export_form_class = ExportForm

Success message
---------------

Expand Down
10 changes: 5 additions & 5 deletions import_export/admin.py
Expand Up @@ -581,8 +581,8 @@ class ExportMixin(BaseExportMixin, ImportExportMixinBase):
"""
Export mixin.
This is intended to be mixed with django.contrib.admin.ModelAdmin
https://docs.djangoproject.com/en/dev/ref/contrib/admin/
This is intended to be mixed with
`ModelAdmin <https://docs.djangoproject.com/en/stable/ref/contrib/admin/>`_.
"""

#: template for change_list view
Expand All @@ -591,9 +591,9 @@ class ExportMixin(BaseExportMixin, ImportExportMixinBase):
export_template_name = "admin/import_export/export.html"
#: export data encoding
to_encoding = None
#: form class to use for the initial export step
#: Use :class:`~import_export.forms.ExportForm` if you would
#: like to disable selectable fields feature
#: Form class to use for the initial export step.
#: Assign to :class:`~import_export.forms.ExportForm` if you would
#: like to disable selectable fields feature.
export_form_class = SelectableFieldsExportForm

def get_urls(self):
Expand Down

0 comments on commit d52fc91

Please sign in to comment.