diff options
| author | Loic Bistuer <loic.bistuer@gmail.com> | 2014-09-27 00:01:34 +0700 |
|---|---|---|
| committer | Loic Bistuer <loic.bistuer@gmail.com> | 2014-09-27 00:36:28 +0700 |
| commit | b23d47412c12352ba2e2133b05a15ccd09e81af3 (patch) | |
| tree | b46c312e2e300077efb5f43c3b56f58e25854497 /django | |
| parent | f5c932ddec8605df82319850d0f0e2f4dad1de11 (diff) | |
Fixed #23560 -- Fixed MigrationWrite to handle builtin types without imports.
Thanks Tim Graham for the review.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/writer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py index 05fcfba202..5bb7d81e34 100644 --- a/django/db/migrations/writer.py +++ b/django/db/migrations/writer.py @@ -352,7 +352,10 @@ class MigrationWriter(object): return string, set(imports) if hasattr(value, "__module__"): module = value.__module__ - return "%s.%s" % (module, value.__name__), set(["import %s" % module]) + if module == six.moves.builtins.__name__: + return value.__name__, set() + else: + return "%s.%s" % (module, value.__name__), set(["import %s" % module]) # Other iterables elif isinstance(value, collections.Iterable): imports = set() |
