瀏覽代碼

Removed unused imports in example migrations.

Arkadiusz Adamski 8 年之前
父節點
當前提交
a76d12ceb4
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      docs/howto/writing-migrations.txt
  2. 1 1
      docs/ref/migration-operations.txt
  3. 2 2
      docs/topics/migrations.txt

+ 1 - 1
docs/howto/writing-migrations.txt

@@ -152,7 +152,7 @@ the respective field according to your needs.
     :filename: 0005_populate_uuid_values.py
 
     # Generated by Django A.B on YYYY-MM-DD HH:MM
-    from django.db import migrations, models
+    from django.db import migrations
     import uuid
 
     def gen_uuid(apps, schema_editor):

+ 1 - 1
docs/ref/migration-operations.txt

@@ -310,7 +310,7 @@ class in the migration file, and just pass it to ``RunPython``. Here's an
 example of using ``RunPython`` to create some initial objects on a ``Country``
 model::
 
-    from django.db import migrations, models
+    from django.db import migrations
 
     def forwards_func(apps, schema_editor):
         # We get the model from the versioned app registry;

+ 2 - 2
docs/topics/migrations.txt

@@ -455,7 +455,7 @@ the file in the right place, suggest a name, and add dependencies for you)::
 Then, open up the file; it should look something like this::
 
     # Generated by Django A.B on YYYY-MM-DD HH:MM
-    from django.db import migrations, models
+    from django.db import migrations
 
     class Migration(migrations.Migration):
         initial = True
@@ -482,7 +482,7 @@ combined values of ``first_name`` and ``last_name`` (we've come to our senses
 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::
 
-    from django.db import migrations, models
+    from django.db import migrations
 
     def combine_names(apps, schema_editor):
         # We can't import the Person model directly as it may be a newer