Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

override django admin change_list_results.html per model

I'm trying to override change_list_results.html only for a particular model. I tried copying the file as with the other templates in the corresponding tree directory ( templates/admin/APP/MODEL ), but this method didn't work. I see in the documentation that overriding per app/model is possible, but it is not described the special method to achieve this. I found some related answer about overriding change_list.html, but I want to override only change_list_results.html and I can't understand how to accomplish just that. What is the way to do this override?

like image 420
symbiotech Avatar asked Aug 13 '13 01:08

symbiotech


1 Answers

I was having the same issue and found this old post. I imagine you fixed yours.

Anyways, what I was doing wrong was to use the plural name of the model and I was also using the lowercase name. You have to be sure of the following:

  • Save your template in /templates/admin/APP/MODEL as you said
  • Check your lower/upper cases in the names of the models
  • This sounds silly, but just in case...Don't use the plural name of the model

Good luck!

like image 177
freethinker6 Avatar answered Sep 29 '22 09:09

freethinker6