mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[1.3.X] Fixed #17749 - Documented better way of overriding ModelAdmin; thanks chrisdpratt and claudep.
Backport of r17582 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@17583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b45fbc6667
commit
38715d8af8
@ -1045,11 +1045,10 @@ provided some extra mapping data that would not otherwise be available::
|
||||
pass
|
||||
|
||||
def change_view(self, request, object_id, extra_context=None):
|
||||
my_context = {
|
||||
'osm_data': self.get_osm_info(),
|
||||
}
|
||||
extra_context = extra_context or {}
|
||||
extra_context['osm_data'] = self.get_osm_info()
|
||||
return super(MyModelAdmin, self).change_view(request, object_id,
|
||||
extra_context=my_context)
|
||||
extra_context=extra_context)
|
||||
|
||||
``ModelAdmin`` media definitions
|
||||
--------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user