Commit 73df1040 authored by Tyson Clugg's avatar Tyson Clugg Committed by Markus Holtermann
Browse files

Cleaned up example migration files in docs

parent e34226fc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -280,7 +280,9 @@ example of using ``RunPython`` to create some initial objects on a ``Country``
model::

    # -*- coding: utf-8 -*-
    from django.db import models, migrations
    from __future__ import unicode_literals

    from django.db import migrations, models

    def forwards_func(apps, schema_editor):
        # We get the model from the versioned app registry;
+6 −2
Original line number Diff line number Diff line
@@ -450,7 +450,9 @@ Then, open up the file; it should look something like this::

    # -*- coding: utf-8 -*-
    # Generated by Django A.B on YYYY-MM-DD HH:MM
    from django.db import models, migrations
    from __future__ import unicode_literals

    from django.db import migrations, models

    class Migration(migrations.Migration):
        initial = True
@@ -478,7 +480,9 @@ and realized that not everyone has first and last names). All we
need to do is use the historical model and iterate over the rows::

    # -*- coding: utf-8 -*-
    from django.db import models, migrations
    from __future__ import unicode_literals

    from django.db import migrations, models

    def combine_names(apps, schema_editor):
        # We can't import the Person model directly as it may be a newer