#16790 closed Bug (fixed)
GeoDjango tutorial error (selecting WorldBorders via admin crashes)
Reported by: | jdiego | Owned by: | jdiego |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | GIS GeoDjango tutorial |
Cc: | john@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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:
old:
def _media(self):
new:
@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.
Attachments (2)
Change History (5)
comment:1 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 13 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 13 years ago
Attachment: | 16790.1.diff added |
---|
by , 13 years ago
Attachment: | 16790.2.diff added |
---|
Added test stub.