1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.7.x] Limited lines to 119 characters in django/{contrib,db}.

Refs #23395.

Backport of c9178ef17a (to decrease chance of backport conflicts) from master
This commit is contained in:
Berker Peksag
2014-10-25 07:42:44 +03:00
committed by Tim Graham
parent 9766ed6a0e
commit d73c7e5db6
9 changed files with 65 additions and 29 deletions

View File

@@ -155,10 +155,12 @@ class MigrationWriter(object):
imports.discard("from django.db import models")
items["imports"] = "\n".join(imports) + "\n" if imports else ""
if migration_imports:
items["imports"] += "\n\n# Functions from the following migrations need manual copying.\n# Move them and any dependencies into this file, then update the\n# RunPython operations to refer to the local versions:\n# %s" % (
"\n# ".join(migration_imports)
)
items["imports"] += (
"\n\n# Functions from the following migrations need manual "
"copying.\n# Move them and any dependencies into this file, "
"then update the\n# RunPython operations to refer to the local "
"versions:\n# %s"
) % "\n# ".join(migration_imports)
# If there's a replaces, make a string for it
if self.migration.replaces:
items['replaces_str'] = "\n replaces = %s\n" % self.serialize(self.migration.replaces)[0]
@@ -394,7 +396,11 @@ class MigrationWriter(object):
return "re.compile(%s)" % ', '.join(args), imports
# Uh oh.
else:
raise ValueError("Cannot serialize: %r\nThere are some values Django cannot serialize into migration files.\nFor more, see https://docs.djangoproject.com/en/dev/topics/migrations/#migration-serializing" % value)
raise ValueError(
"Cannot serialize: %r\nThere are some values Django cannot serialize into "
"migration files.\nFor more, see https://docs.djangoproject.com/en/dev/"
"topics/migrations/#migration-serializing" % value
)
MIGRATION_TEMPLATE = """\