mirror of
https://github.com/django/django.git
synced 2025-06-06 20:19:13 +00:00
[3.2.x] Fixed #32755 -- Corrected Model.get_absolute_url() example in docs.
Backport of 27d4573d35935bff83c28bfd68a2ce5a7a6c600a from main
This commit is contained in:
parent
ce78bc9808
commit
65b680a99a
@ -715,7 +715,7 @@ For example::
|
|||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
return reverse('people.views.details', args=[str(self.id)])
|
return reverse('people-detail', kwargs={'pk' : self.pk})
|
||||||
|
|
||||||
One place Django uses ``get_absolute_url()`` is in the admin app. If an object
|
One place Django uses ``get_absolute_url()`` is in the admin app. If an object
|
||||||
defines this method, the object-editing page will have a "View on site" link
|
defines this method, the object-editing page will have a "View on site" link
|
||||||
|
Loading…
x
Reference in New Issue
Block a user