Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17749 - Documented better way of overriding ModelAdmin; thanks…

… chrisdpratt and claudep.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17582 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e4f468b9405ce7560dd00a383138f7d15e8549ec 1 parent 1525874
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
@@ -1278,11 +1278,10 @@ provided some extra mapping data that would not otherwise be available::
1278 1278
             pass
1279 1279
 
1280 1280
         def change_view(self, request, object_id, extra_context=None):
1281  
-            my_context = {
1282  
-                'osm_data': self.get_osm_info(),
1283  
-            }
  1281
+            extra_context = extra_context or {}
  1282
+            extra_context['osm_data'] = self.get_osm_info()
1284 1283
             return super(MyModelAdmin, self).change_view(request, object_id,
1285  
-                extra_context=my_context)
  1284
+                extra_context=extra_context)
1286 1285
 
1287 1286
 .. versionadded:: 1.4
1288 1287
 

0 notes on commit e4f468b

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