Hello, i'd like to pass an argument {{x}} to my custom file change_form.html, which is located in /home/django/project/app/template/admin/change_form.html. i found this code but it doesnt work. thx for any help
class MyModelAdmin(admin.ModelAdmin):
# A template for a very customized change view:
change_form_template = 'admin/change_form.html'
def get_osm_info(self):
z = Klass()
x = z.final_down()
return x
def change_view(self, request, object_id, extra_context=None):
my_context = { 'x': get_osm_info(),}
return super(MyModelAdmin, self).change_view(request, object_id,extra_context=my_context)