Fixed #32755 -- Corrected Model.get_absolute_url() example in docs.

This commit is contained in:
Girish Sontakke 2021-05-18 15:00:38 +05:30 committed by GitHub
parent f7691d4812
commit 27d4573d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -715,7 +715,7 @@ For example::
def get_absolute_url(self):
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
defines this method, the object-editing page will have a "View on site" link