diff options
| author | Curtis Maloney <curtis@tinbrain.net> | 2018-09-11 03:00:34 +1000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-09-10 14:38:08 -0400 |
| commit | 1853e2dbf2e290ec04e3389d523bbe4bad94a42e (patch) | |
| tree | c63e2721c7e691ae88a4ad9e5135b1f042bab857 /docs/topics/forms | |
| parent | 2b2474b75d63fcded37b872fcd2bb543d7502a8a (diff) | |
[2.1.x] Refs #20910 -- Replaced snippet directive with code-block.
Backport of c49ea6f5911296dcb40190c905e38b43cdc7c7a3 from master
Diffstat (limited to 'docs/topics/forms')
| -rw-r--r-- | docs/topics/forms/index.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index f8ef20a9bc..8340c0f096 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -226,8 +226,8 @@ The :class:`Form` class We already know what we want our HTML form to look like. Our starting point for it in Django is this: -.. snippet:: - :filename: forms.py +.. code-block:: python + :caption: forms.py from django import forms @@ -276,8 +276,8 @@ logic. To handle the form we need to instantiate it in the view for the URL where we want it to be published: -.. snippet:: - :filename: views.py +.. code-block:: python + :caption: views.py from django.http import HttpResponseRedirect from django.shortcuts import render @@ -404,8 +404,8 @@ More on fields Consider a more useful form than our minimal example above, which we could use to implement "contact me" functionality on a personal website: -.. snippet:: - :filename: forms.py +.. code-block:: python + :caption: forms.py from django import forms @@ -453,8 +453,8 @@ values to a Python ``int`` and ``float`` respectively. Here's how the form data could be processed in the view that handles this form: -.. snippet:: - :filename: views.py +.. code-block:: python + :caption: views.py from django.core.mail import send_mail |
