fix: Django2.1 ImportExportModelAdmin export (#797) (#819)

This commit is contained in:
Bojan Mihelac 2018-08-09 14:43:39 +02:00 committed by GitHub
parent 8f87b5aed4
commit 54232db4a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 5 deletions

View File

@ -398,11 +398,23 @@ class ExportMixin(ImportExportMixinBase):
list_display = ['action_checkbox'] + list(list_display)
ChangeList = self.get_changelist(request)
cl = ChangeList(request, self.model, list_display,
list_display_links, list_filter, self.date_hierarchy,
search_fields, self.list_select_related, self.list_per_page,
self.list_max_show_all, self.list_editable, self
)
changelist_kwargs = {
'request': request,
'model': self.model,
'list_display': list_display,
'list_display_links': list_display_links,
'list_filter': list_filter,
'date_hierarchy': self.date_hierarchy,
'search_fields': search_fields,
'list_select_related': self.list_select_related,
'list_per_page': self.list_per_page,
'list_max_show_all': self.list_max_show_all,
'list_editable': self.list_editable,
'model_admin': self,
}
if django.VERSION >= (2, 1):
changelist_kwargs['sortable_by'] = self.sortable_by
cl = ChangeList(**changelist_kwargs)
return cl.get_queryset(request)