tags:

views:

35

answers:

1

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)
A: 

ok. as i said before, i'd like to pass an argument to my custom file 'change_form.html'. the argument is a value from final_down method. i expected to see this value in my html file. i saw nothing, no error at all

paveu