I can override edit_inline/tabular.html
if I save it in my overall template directory (for example mysite/templates/admin/edit_inline/tabular.html
), but when I try to save it with other admin template, like change_form.html
(in mysite/myapp/templates/admin/myapp/mymodel/change_form.html
, it doesn't works.
I come across this thread which is a bit old, in fact for the inline model you need to explicitly set your new template in your admin.py like below :
class ModelInlineAdmin(admin.StackedInline):
model = Product
template = "admin/products/product/edit_inline/stacked.html"
check this http://blog.ruedaminute.com/2011/05/django-journal-override-a-django-admin-template-inline-or-otherwise/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With