-
-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportExportMixin overlaps change_list_template property making it not compatible with other mixins #1450
Labels
Comments
Wanted to say thanks for this info, used it to resolve a similar problem. Likely something we ought to fix in the main code! |
nikhaldi
pushed a commit
to nikhaldi/django-import-export
that referenced
this issue
Aug 30, 2022
This allows users to customize the change list templates when using mixins provided by the library. In particular this enables adding more items to the object tools, in addition to the ones added by the admin mixins. This then makes this library compatible with other libraries that extend the objec tools, such as `django-admin-sortable2` or `reversion`. Fixes django-import-export#1450
I've submitted a PR I think addresses this problem. I ran into this in combination with the reversion library, not django-admin-sortable2, but the underlying issue is the same. |
nikhaldi
pushed a commit
to nikhaldi/django-import-export
that referenced
this issue
Aug 31, 2022
This allows users to customize the change list templates when using mixins provided by the library. In particular this enables adding more items to the object tools, in addition to the ones added by the admin mixins. This then makes this library compatible with other libraries that extend the object tools, such as `django-admin-sortable2` or `reversion`. Fixes django-import-export#1450
matthewhegarty
pushed a commit
that referenced
this issue
Sep 6, 2022
* Allow custom change_list_template in admin views using mixins This allows users to customize the change list templates when using mixins provided by the library. In particular this enables adding more items to the object tools, in addition to the ones added by the admin mixins. This then makes this library compatible with other libraries that extend the object tools, such as `django-admin-sortable2` or `reversion`. Fixes #1450 * Turn custom test change list item into real link Looks less confusing like this in the demo app. * Don't make custom change list template test affect the rendering Should avoid confusion by users using the sample application. * Update changelog.rst * Describe potential breaking changes * Make sure test template customization doesn't render * corrected typo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If I combine
ImportExportMixin
withSortableAdminMixin
fromdjango-admin-sortable2
I can't get both functionalities to work together.I have already described the issue and made PR for
django-admin-sortable2
: jrief/django-admin-sortable2#316That fixes the issue combined usage of mixins from these two applications, but the same issue is present in
django-admin-sortable2
as well and could raise problems when combining with other applications (or if user sets up differentchange_list_template
parameter).The same principle to fix this should be used also for
django-import-export
. Setting of thechange_list_template
parameters inImportMixin
,ExportMixin
,ImportExportMixin
should be moved to__init__
, the original value should be stored and used in{% extends %}
tag of theadmin/change_list.html
template.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: