summaryrefslogtreecommitdiff
path: root/docs/howto
diff options
context:
space:
mode:
Diffstat (limited to 'docs/howto')
-rw-r--r--docs/howto/initial-data.txt2
-rw-r--r--docs/howto/writing-migrations.txt20
2 files changed, 11 insertions, 11 deletions
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