#16790: GeoDjango tutorial error (selecting WorldBorders via admin crashes)
------------------------------------+----------------------------
Reporter: jdiego | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: GIS
Version: SVN | Severity: Normal
Keywords: GIS GeoDjango tutorial | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+----------------------------
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/16790>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.