GeoDjango tutorial error (selecting WorldBorders via admin crashes)
|Reported by:||jdiego||Owned by:||jdiego|
|Severity:||Normal||Keywords:||GIS GeoDjango tutorial|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
First time django contributor; I may be doing something wrong, but here it goes...
Note that the crash does not occur with the 1.3.0 release (I'm running trunk, 1.4.0 alpha).
Got to the following point in the tutorial: "Finally, browse to http://localhost:8000/admin/, and log in with the admin user created after running syncdb. Browse to any of the WorldBorders entries"
Clicking on "WorldBorders" causes the crash: "'super' object has no attribute '_media'"
The following seems to be the problem:
the first thing that django.contrib.gis.admin.options.GeoModelAdmin._media()
does is to invoke...
media = super(GeoModelAdmin, self)._media()
The problem is that there was a recent changeset (16594) in the parent class (ModelAdmin). In that changeset the following changed:
@property def media(self):
I tested a patch (which I'll submit shortly) where GeoModelAdmin gets "media" from its parent as a property, instead of getting it via a method call. This seems to fix the problem.
media = super(GeoModelAdmin, self).media
Note that I ran the GeoDjangoTestSuiteRunner tests and although there were some errors, none of them seem to correspond to this case; however, I'm not positive about this.