summaryrefslogtreecommitdiff
path: root/docs/topics/migrations.txt
diff options
context:
space:
mode:
authorMarkus Amalthea Magnuson <markus.magnuson@gmail.com>2017-05-22 18:06:49 +0200
committerTim Graham <timograham@gmail.com>2017-05-22 12:06:49 -0400
commit266b24316841f878c129e6dbb026f6c3edcdb54f (patch)
tree63281d86d6028f7fbba9d20400427a707a94c3c2 /docs/topics/migrations.txt
parent04ab96ec4fa7b8ce9a006cc929c152e137ac3a77 (diff)
downloaddjango-266b24316841f878c129e6dbb026f6c3edcdb54f.tar.gz
Made docs/topics/migrations.txt use single quotes consistently.
Diffstat (limited to 'docs/topics/migrations.txt')
-rw-r--r--docs/topics/migrations.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt
index 938ba31112..edb4d84e98 100644
--- a/docs/topics/migrations.txt
+++ b/docs/topics/migrations.txt
@@ -205,11 +205,11 @@ A basic migration file looks like this::
class Migration(migrations.Migration):
- dependencies = [("migrations", "0001_initial")]
+ dependencies = [('migrations', '0001_initial')]
operations = [
- migrations.DeleteModel("Tribble"),
- migrations.AddField("Author", "rating", models.IntegerField(default=0)),
+ migrations.DeleteModel('Tribble'),
+ migrations.AddField('Author', 'rating', models.IntegerField(default=0)),
]
What Django looks for when it loads a migration file (as a Python module) is
@@ -486,9 +486,9 @@ need to do is use the historical model and iterate over the rows::
def combine_names(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
- Person = apps.get_model("yourappname", "Person")
+ Person = apps.get_model('yourappname', 'Person')
for person in Person.objects.all():
- person.name = "%s %s" % (person.first_name, person.last_name)
+ person.name = '%s %s' % (person.first_name, person.last_name)
person.save()
class Migration(migrations.Migration):