Skip to content

Commit

Permalink
renamed get_export_form as get_aa_export_form
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Nov 1, 2023
1 parent 167d757 commit c3a8704
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release <dev>
* fixes support for 'MemoryFileUploadHandler' in bulk_update
* add `dry_run` option to bulk_update
* bulk_update now returns a page with pre/post action field values
* renamed `get_export_form` as `get_aa_export_form` ( @see https://github.com/saxix/django-adminactions/issues/217)


Release 2.1
Expand Down
16 changes: 8 additions & 8 deletions src/adminactions/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def base_export(


def export_as_csv(modeladmin, request, queryset):
if hasattr(modeladmin, "get_export_form"):
form_class = modeladmin.get_export_form(request, "csv") or CSVOptions
if hasattr(modeladmin, "get_aa_export_form"):
form_class = modeladmin.get_aa_export_form(request, "csv") or CSVOptions
else:
form_class = CSVOptions
return base_export(
Expand All @@ -175,8 +175,8 @@ def export_as_csv(modeladmin, request, queryset):


def export_as_xls(modeladmin, request, queryset):
if hasattr(modeladmin, "get_export_form"):
form_class = modeladmin.get_export_form(request, "xls") or XLSOptions
if hasattr(modeladmin, "get_aa_export_form"):
form_class = modeladmin.get_aa_export_form(request, "xls") or XLSOptions
else:
form_class = XLSOptions
return base_export(
Expand Down Expand Up @@ -292,8 +292,8 @@ def export_as_fixture(modeladmin, request, queryset):
except ActionInterrupted as e:
messages.error(request, str(e))
return
if hasattr(modeladmin, "get_export_form"):
form_class = modeladmin.get_export_form(request, "fixture") or FixtureOptions
if hasattr(modeladmin, "get_aa_export_form"):
form_class = modeladmin.get_aa_export_form(request, "fixture") or FixtureOptions
else:
form_class = FixtureOptions

Expand Down Expand Up @@ -401,8 +401,8 @@ def export_delete_tree(modeladmin, request, queryset): # noqa
"indent": 4,
}

if hasattr(modeladmin, "get_export_form"):
form_class = modeladmin.get_export_form(request, "delete") or FixtureOptions
if hasattr(modeladmin, "get_aa_export_form"):
form_class = modeladmin.get_aa_export_form(request, "delete") or FixtureOptions
else:
form_class = FixtureOptions

Expand Down

0 comments on commit c3a8704

Please sign in to comment.