Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit 38715d8af83ba73db6f80c832fe04089f2cc6644 1 parent b45fbc6
Tim Graham authored February 24, 2012

Showing 1 changed file with 3 additions and 4 deletions. Show diff stats Hide diff stats

  1. 7  docs/ref/contrib/admin/index.txt
7  docs/ref/contrib/admin/index.txt
@@ -1045,11 +1045,10 @@ provided some extra mapping data that would not otherwise be available::
1045 1045
             pass
1046 1046
 
1047 1047
         def change_view(self, request, object_id, extra_context=None):
1048  
-            my_context = {
1049  
-                'osm_data': self.get_osm_info(),
1050  
-            }
  1048
+            extra_context = extra_context or {}
  1049
+            extra_context['osm_data'] = self.get_osm_info()
1051 1050
             return super(MyModelAdmin, self).change_view(request, object_id,
1052  
-                extra_context=my_context)
  1051
+                extra_context=extra_context)
1053 1052
 
1054 1053
 ``ModelAdmin`` media definitions
1055 1054
 --------------------------------

0 notes on commit 38715d8

Please sign in to comment.
Something went wrong with that request. Please try again.