#237 closed defect (invalid)
get_absolute_url doesn't show up right in admin
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I defined a get_absolute_url in a model to give '/files/something/' urls for objects. The admin shows the "view on site" link, but that link point's to /r/14/1 in my test - the view-on-site link doesn't point to the return value of the get_absolute_url method.
Change History (3)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This has to do with the way those "view on site" links work; if you click on the link you'll see that you're redirected to the object's real URL from that /r/ place. It's an indirect link because of the way Django's admin handles multiple sites (look at django.views.defaults.shortcut
)
comment:3 by , 19 years ago
Ok, so it's just missing the documentation for the /r/ stuff - because none of the tutorial settings do set up an urlmatcher for /r/ and so you just get a 404 when clicking the "view on site" link.
The relevant code is part of my tutorial at http://hugo.muensterland.org/2005/07/31/writing-a-simple-filesystem-browser-with-django/