Opened 16 years ago

Closed 15 years ago

Last modified 13 years ago

#8971 closed (fixed)

URL resolution for admindocs reST roles incorrect

Reported by: Ben Spaulding Owned by: Armin Ronacher
Component: contrib.admin Version: dev
Severity: Keywords: admindocs urls
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The parse_rst method in admindocs/utils.py has a link_base argument set to "../.." — that works fine if the the link being created is in either the model_detail or view_detail view. But if the view is being created in the tag_index or detail_index the url does not resolve correctly.

The attached patch is a solid solution, but possibly temporary. It simply has the tag_index and model_index views pass parse_rst a link_base kwarg set to the correct relative URL. I think a better solution would be to have the roles’ URLs use reverse() rather than be hard-coded. I tried to do that, but it is difficult as reverse() needs views.py to resolve the URL and views.py relies on utils.py. I am sure it can be done, but I couldn’t figure out how.

Attachments (2)

admindocs-link_base.diff (2.0 KB ) - added by Ben Spaulding 16 years ago.
8971-reverse.patch (1.1 KB ) - added by Armin Ronacher 15 years ago.
reverses the url to the root properly

Download all attachments as: .zip

Change History (10)

by Ben Spaulding, 16 years ago

Attachment: admindocs-link_base.diff added

comment:1 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 by Russell Keith-Magee, 15 years ago

Component: Uncategorizeddjango.contrib.admin

comment:3 by Armin Ronacher, 15 years ago

Owner: changed from nobody to Armin Ronacher

comment:4 by Armin Ronacher, 15 years ago

Attached a patch that drops link_base and reverses the url to the root properly.

by Armin Ronacher, 15 years ago

Attachment: 8971-reverse.patch added

reverses the url to the root properly

comment:5 by Armin Ronacher, 15 years ago

Triage Stage: AcceptedReady for checkin

Ready for commit :-)

comment:6 by Jacob, 15 years ago

Resolution: fixed
Status: newclosed

(In [10683]) Fixed #8971: correctly reverse urls in admindocs reST roles. Thanks, mitsuhiko.

comment:7 by Jacob, 15 years ago

(In [10685]) [1.0.X] Fixed #8971: correctly reverse urls in admindocs reST roles. Thanks, mitsuhiko. Backport of [10683] from trunk.

comment:8 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top