Skip to content

Commit

Permalink
Cleaned up example migration files in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tysonclugg authored and MarkusH committed Aug 31, 2015
1 parent e34226f commit 73df104
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/ref/migration-operations.txt
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions docs/topics/migrations.txt
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73df104

Please sign in to comment.