mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #19516 - Fixed remaining broken links.
Added -n to sphinx builds to catch issues going forward.
This commit is contained in:
parent
3f890f8dc7
commit
9b5f64cc6e
83 changed files with 727 additions and 611 deletions
|
@ -234,12 +234,12 @@ two views abstract the concepts of "display a list of objects" and
|
|||
* Each generic view needs to know what model it will be acting
|
||||
upon. This is provided using the ``model`` parameter.
|
||||
|
||||
* The :class:`~django.views.generic.list.DetailView` generic view
|
||||
* The :class:`~django.views.generic.detail.DetailView` generic view
|
||||
expects the primary key value captured from the URL to be called
|
||||
``"pk"``, so we've changed ``poll_id`` to ``pk`` for the generic
|
||||
views.
|
||||
|
||||
By default, the :class:`~django.views.generic.list.DetailView` generic
|
||||
By default, the :class:`~django.views.generic.detail.DetailView` generic
|
||||
view uses a template called ``<app name>/<model name>_detail.html``.
|
||||
In our case, it'll use the template ``"polls/poll_detail.html"``. The
|
||||
``template_name`` argument is used to tell Django to use a specific
|
||||
|
@ -247,7 +247,7 @@ template name instead of the autogenerated default template name. We
|
|||
also specify the ``template_name`` for the ``results`` list view --
|
||||
this ensures that the results view and the detail view have a
|
||||
different appearance when rendered, even though they're both a
|
||||
:class:`~django.views.generic.list.DetailView` behind the scenes.
|
||||
:class:`~django.views.generic.detail.DetailView` behind the scenes.
|
||||
|
||||
Similarly, the :class:`~django.views.generic.list.ListView` generic
|
||||
view uses a default template called ``<app name>/<model
|
||||
|
@ -257,7 +257,7 @@ name>_list.html``; we use ``template_name`` to tell
|
|||
|
||||
In previous parts of the tutorial, the templates have been provided
|
||||
with a context that contains the ``poll`` and ``latest_poll_list``
|
||||
context variables. For DetailView the ``poll`` variable is provided
|
||||
context variables. For ``DetailView`` the ``poll`` variable is provided
|
||||
automatically -- since we're using a Django model (``Poll``), Django
|
||||
is able to determine an appropriate name for the context variable.
|
||||
However, for ListView, the automatically generated context variable is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue