diff options
| author | Tyson Clugg <tyson@clugg.net> | 2015-08-11 18:07:04 +1000 |
|---|---|---|
| committer | Markus Holtermann <info@markusholtermann.eu> | 2015-08-31 22:15:05 +1000 |
| commit | 73df1040a2b779f41c92d835df956db23654dae9 (patch) | |
| tree | a06b0d57f76b01e97246dd3f9d74f90594bfcd1f /docs | |
| parent | e34226fc37dfa9eba89d913fd7ab8e95663b0d64 (diff) | |
Cleaned up example migration files in docs
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/migration-operations.txt | 4 | ||||
| -rw-r--r-- | docs/topics/migrations.txt | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index a5a74d3be0..8dbebcccc6 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -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; diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt index d7aa7051d1..4fe3b5d329 100644 --- a/docs/topics/migrations.txt +++ b/docs/topics/migrations.txt @@ -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 |
