In current versions of django, the decorator literally calls the reverse
function that the documentation recommends anyway. The reason seems to be that the decorator is unnecessary now that we have reverse()
. Using reverse
does look nicer than returning a name, a tuple, and a dictionary. Instead, you use args and kwargs - idiomatic python.
And this is the ticket that discussed deprecating the decorator for API purity sake. Instead of raising warnings and making users update code bases, they decided to simply put a warning in the docs.
The permalink decorator should be deprecated and ultimately removed.
It was introduced to solve the problem of having to hardcode urls into get_absolute_url. However it violates one of the major rules of good decorators in that in forces the function signature to change in order to deal with the fact it's been decorated. Additionally it does not provide any useful functionality over using reverse() directly within the body of get_absolute_url.