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/howto/initial-data.txt | 2 +- docs/howto/writing-migrations.txt | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'docs/howto') diff --git a/docs/howto/initial-data.txt b/docs/howto/initial-data.txt index 64012f66b9..fcfecc82a1 100644 --- a/docs/howto/initial-data.txt +++ b/docs/howto/initial-data.txt @@ -58,7 +58,7 @@ look like in JSON: And here's that same fixture as YAML: -.. code-block:: none +.. code-block:: yaml - model: myapp.person pk: 1 diff --git a/docs/howto/writing-migrations.txt b/docs/howto/writing-migrations.txt index 4596f64eb6..f98a56c534 100644 --- a/docs/howto/writing-migrations.txt +++ b/docs/howto/writing-migrations.txt @@ -39,8 +39,8 @@ attribute:: You can also provide hints that will be passed to the :meth:`allow_migrate()` method of database routers as ``**hints``: -.. snippet:: - :filename: myapp/dbrouters.py +.. code-block:: python + :caption: myapp/dbrouters.py class MyRouter: @@ -97,8 +97,8 @@ the respective field according to your needs. of the three new files) to the last migration, change ``AddField`` to ``AlterField``, and add imports of ``uuid`` and ``models``. For example: - .. snippet:: - :filename: 0006_remove_uuid_null.py + .. code-block:: python + :caption: 0006_remove_uuid_null.py # Generated by Django A.B on YYYY-MM-DD HH:MM from django.db import migrations, models @@ -121,8 +121,8 @@ the respective field according to your needs. * Edit the first migration file. The generated migration class should look similar to this: - .. snippet:: - :filename: 0004_add_uuid_field.py + .. code-block:: python + :caption: 0004_add_uuid_field.py class Migration(migrations.Migration): @@ -148,8 +148,8 @@ the respective field according to your needs. unique value (UUID in the example) for each existing row. Also add an import of ``uuid``. For example: - .. snippet:: - :filename: 0005_populate_uuid_values.py + .. code-block:: python + :caption: 0005_populate_uuid_values.py # Generated by Django A.B on YYYY-MM-DD HH:MM from django.db import migrations @@ -279,8 +279,8 @@ project anywhere without first installing and then uninstalling the old app. Here's a sample migration: -.. snippet:: - :filename: myapp/migrations/0124_move_old_app_to_new_app.py +.. code-block:: python + :caption: myapp/migrations/0124_move_old_app_to_new_app.py from django.apps import apps as global_apps from django.db import migrations -- cgit v1.3