omji / django-tabbed-admin

Easily add tabs to django admin forms
BSD 3-Clause "New" or "Revised" License
63 stars 68 forks source link

Template override per model #10

Open fdemmer opened 7 years ago

fdemmer commented 7 years ago

Some Django admin templates can be overridden globally, per app or per model: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#templates-which-may-be-overridden-per-app-or-model

With tabbed admin, that seems partially broken. i can globally override eg "change_form.html", but not per app or model. Can anyone confirm this behaviour?

omji commented 7 years ago

Hi,

This app is overriding change_form.html in order to add the html for the tabs within the form. The override happens on the class level and happens there:

https://github.com/omji/django-tabbed-admin/blob/master/tabbed_admin/admin.py#L13

If one of your admin class inherits from TabbedModelAdmin and you want to add custom changes to the change form, you might want to override the change form from this app and the change_form_template attribute. Happy to ear and implement a cleaner and more practical solution if any :-)

Thanks