Closed PetrDlouhy closed 2 years ago
I have added test for the new behavior (which also tests, that GET will put the JSON values in the response). I rebased to 2.0.2, which is the last version with passing tests, but I still got timeouts. I don't know what is the problem, but I expect it is not the new code.
@jrief Could you please try to remember or test this code in your environment to determine what caused the "it didn't work" problem? I am willing to fix all the problems, but right now I couldn't think how the mechanism I have used can fail.
Or if somebody else could test this to confirm/disprove the problems, I would be really glad. I am using this on different project than the original PR and it works fine.
Unit tests run on my local machiche. However, for reasons unknown to me, they fail on GH actions. I have to investigate further. I'll merge this solution soon. Thanks for investigating.
@PetrDlouhy I used your pull request as a starting point but implemented it in a slightly simpler way. I also created a unit test to check if the template is overridden. Please have a look at the HEAD of the repository.
@jrief The new version seems to work nicely. Thank you very much.
Fix #316
The problem is caused by
django-admin-sortable2
ignoring the value ofchange_list_template
property from previous mixins. This PR stores renames thechangoe_list_template
tosortable_change_list_template
to allow access to the original property value. Then it sets the new value in__init__
, but uses the original value as base template foradmin/change_list.html
so that overriding of these templates is chained together.