I want to pass a list of object to my custom template in Djando admin, delete_view and change_view. I modified base_site.html for including a nav-bar and I want to pass, from view, a list of objects to the nav-bar.
I did it before for django admin index, changelist_view and add_view as well. I override those function and add the extra content I want.
But I can´t do it in the two firts. The idea should be this one:
@csrf_protect_m
@transaction.atomic
def delete_view(self, request, object_id, extra_context=None):
extra_context = extra_context or {}
mygetModels = getModels()
extra_context["modelsTables"] = mygetModels.getTablesModels()
return super(table_NameAdmin, self).delete_view(request, object_id, extra_context)
As I said that works before in changelist_view, index and add_view. But is not working in delete_view and change_view.