﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9965	Change import in permalink decorator from function to module	Joost Cassee	Malcolm Tredinnick	"The `permalink` decorator uses the `urlresolvers.reverse` function to generate a permanent link to objects. It imports the `reverse` function itself instead of the `urlresolvers` module. This causes trouble in projects that also use the `localeurl` application, because this application monkey-patches the `reverse` function in order to add a prefix. Although monkey-patching a core Django function is bad form, it is currently the only way I see to provide this functionality. Additionally, importing elements from a module instead of the module itself is slightly frowned upon in general ([http://docs.python.org/howto/doanddont.html#from-module-import-name1-name2 Python docs], [http://www.python.org/doc/faq/programming/#how-can-i-have-modules-that-mutually-import-each-other Python FAQ]: ""Guido van Rossum recommends..."", [http://www.effbot.org/zone/import-confusion.htm Fredrik Lundh]). It is common in Django, though, so that might not impress anyone.

The attached patch changes the `permalink` decorator to import the `urlresolvers` module instead of the `reverse` function. Because the change is small, I hope the patch will be accepted."		closed	Database layer (models, ORM)	dev		wontfix			Unreviewed	1	0	0	0	0	0
