Browse Source

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

Girish Sontakke 3 năm trước cách đây
mục cha
commit
27d4573d35
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      docs/ref/models/instances.txt

+ 1 - 1
docs/ref/models/instances.txt

@@ -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