diff options
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 |
