summaryrefslogtreecommitdiff
path: root/docs/intro/tutorial02.txt
diff options
context:
space:
mode:
authorCurtis Maloney <curtis@tinbrain.net>2018-09-11 03:00:34 +1000
committerTim Graham <timograham@gmail.com>2018-09-10 13:00:34 -0400
commitc49ea6f5911296dcb40190c905e38b43cdc7c7a3 (patch)
tree56d6341ed09e5d77cd3361bcc5275eab5733db4a /docs/intro/tutorial02.txt
parentf8ff529ee32c79b270176f5e8d7a3f6ef048ac31 (diff)
Refs #20910 -- Replaced snippet directive with code-block.
Diffstat (limited to 'docs/intro/tutorial02.txt')
-rw-r--r--docs/intro/tutorial02.txt20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt
index ea9c3dff56..4d2a62bec2 100644
--- a/docs/intro/tutorial02.txt
+++ b/docs/intro/tutorial02.txt
@@ -135,8 +135,8 @@ with a ``Question``.
These concepts are represented by simple Python classes. Edit the
:file:`polls/models.py` file so it looks like this:
-.. snippet::
- :filename: polls/models.py
+.. code-block:: python
+ :caption: polls/models.py
from django.db import models
@@ -211,8 +211,8 @@ is ``'polls.apps.PollsConfig'``. Edit the :file:`mysite/settings.py` file and
add that dotted path to the :setting:`INSTALLED_APPS` setting. It'll look like
this:
-.. snippet::
- :filename: mysite/settings.py
+.. code-block:: python
+ :caption: mysite/settings.py
INSTALLED_APPS = [
'polls.apps.PollsConfig',
@@ -423,8 +423,8 @@ representation of this object. Let's fix that by editing the ``Question`` model
:meth:`~django.db.models.Model.__str__` method to both ``Question`` and
``Choice``:
-.. snippet::
- :filename: polls/models.py
+.. code-block:: python
+ :caption: polls/models.py
from django.db import models
@@ -446,8 +446,8 @@ automatically-generated admin.
Note these are normal Python methods. Let's add a custom method, just for
demonstration:
-.. snippet::
- :filename: polls/models.py
+.. code-block:: python
+ :caption: polls/models.py
import datetime
@@ -644,8 +644,8 @@ Just one thing to do: we need to tell the admin that ``Question``
objects have an admin interface. To do this, open the :file:`polls/admin.py`
file, and edit it to look like this:
-.. snippet::
- :filename: polls/admin.py
+.. code-block:: python
+ :caption: polls/admin.py
from django.contrib import admin