From 1853e2dbf2e290ec04e3389d523bbe4bad94a42e Mon Sep 17 00:00:00 2001 From: Curtis Maloney Date: Tue, 11 Sep 2018 03:00:34 +1000 Subject: [2.1.x] Refs #20910 -- Replaced snippet directive with code-block. Backport of c49ea6f5911296dcb40190c905e38b43cdc7c7a3 from master --- docs/topics/forms/index.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'docs/topics/forms') 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 -- cgit v1.3