mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #26013 -- Moved django.core.urlresolvers to django.urls.
Thanks to Tim Graham for the review.
This commit is contained in:
committed by
Tim Graham
parent
df3d5b1d73
commit
16411b8400
@@ -672,14 +672,14 @@ For example::
|
||||
def get_absolute_url(self):
|
||||
return "/people/%i/" % self.id
|
||||
|
||||
(Whilst this code is correct and simple, it may not be the most portable way to
|
||||
write this kind of method. The :func:`~django.core.urlresolvers.reverse`
|
||||
function is usually the best approach.)
|
||||
While this code is correct and simple, it may not be the most portable way to
|
||||
to write this kind of method. The :func:`~django.urls.reverse` function is
|
||||
usually the best approach.
|
||||
|
||||
For example::
|
||||
|
||||
def get_absolute_url(self):
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
return reverse('people.views.details', args=[str(self.id)])
|
||||
|
||||
One place Django uses ``get_absolute_url()`` is in the admin app. If an object
|
||||
|
||||
Reference in New Issue
Block a user