diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-05-31 07:40:54 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-06-27 08:04:25 +0200 |
| commit | 4d20d2f7c2b8e74c3e85bd0716ebdcb3b35a70e6 (patch) | |
| tree | 40722f3317489da559dce2c04da404f1fe61709d /docs/topics/class-based-views | |
| parent | 8a294ee2e0e30f073f764310c74899e385a302ec (diff) | |
[4.0.x] Fixed docs build with sphinxcontrib-spelling 7.5.0+.
sphinxcontrib-spelling 7.5.0+ includes captions of figures in the set
of nodes for which the text is checked.
Backport of ac90529cc58507d9a07610809a795ec5fc3cbf8c from main.
Diffstat (limited to 'docs/topics/class-based-views')
| -rw-r--r-- | docs/topics/class-based-views/generic-editing.txt | 14 | ||||
| -rw-r--r-- | docs/topics/class-based-views/mixins.txt | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/docs/topics/class-based-views/generic-editing.txt b/docs/topics/class-based-views/generic-editing.txt index 5bc56b84e1..b40d306898 100644 --- a/docs/topics/class-based-views/generic-editing.txt +++ b/docs/topics/class-based-views/generic-editing.txt @@ -19,7 +19,7 @@ Basic forms Given a contact form: .. code-block:: python - :caption: forms.py + :caption: ``forms.py`` from django import forms @@ -34,7 +34,7 @@ Given a contact form: The view can be constructed using a ``FormView``: .. code-block:: python - :caption: views.py + :caption: ``views.py`` from myapp.forms import ContactForm from django.views.generic.edit import FormView @@ -97,7 +97,7 @@ First we need to add :meth:`~django.db.models.Model.get_absolute_url()` to our ``Author`` class: .. code-block:: python - :caption: models.py + :caption: ``models.py`` from django.db import models from django.urls import reverse @@ -113,7 +113,7 @@ work. Notice how we're just configuring the generic class-based views here; we don't have to write any logic ourselves: .. code-block:: python - :caption: views.py + :caption: ``views.py`` from django.urls import reverse_lazy from django.views.generic.edit import CreateView, DeleteView, UpdateView @@ -147,7 +147,7 @@ and :attr:`~django.views.generic.edit.FormMixin.form_class` attributes, an Finally, we hook these new views into the URLconf: .. code-block:: python - :caption: urls.py + :caption: ``urls.py`` from django.urls import path from myapp.views import AuthorCreateView, AuthorDeleteView, AuthorUpdateView @@ -188,7 +188,7 @@ you can use a custom :class:`~django.forms.ModelForm` to do this. First, add the foreign key relation to the model: .. code-block:: python - :caption: models.py + :caption: ``models.py`` from django.contrib.auth.models import User from django.db import models @@ -204,7 +204,7 @@ to edit, and override :meth:`~django.views.generic.edit.ModelFormMixin.form_valid()` to add the user: .. code-block:: python - :caption: views.py + :caption: ``views.py`` from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic.edit import CreateView diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt index 08a1ec1af9..4d622211d6 100644 --- a/docs/topics/class-based-views/mixins.txt +++ b/docs/topics/class-based-views/mixins.txt @@ -221,7 +221,7 @@ We'll demonstrate this with the ``Author`` model we used in the :doc:`generic class-based views introduction<generic-display>`. .. code-block:: python - :caption: views.py + :caption: ``views.py`` from django.http import HttpResponseForbidden, HttpResponseRedirect from django.urls import reverse @@ -253,7 +253,7 @@ look up the author we're interested in, which it does with a call to We can hook this into our URLs easily enough: .. code-block:: python - :caption: urls.py + :caption: ``urls.py`` from django.urls import path from books.views import RecordInterestView |
