From 72479a29579f72a7713ac3c07eb92f5bafee25bd Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 6 Dec 2013 15:20:16 +0100 Subject: [PATCH] Made the migration detector use meta.local_fields instead of meta.fields. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #21010. Thanks to Loïc for the patch. --- django/db/migrations/autodetector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index 86ddd3c3d2..78c9770366 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -67,7 +67,7 @@ class MigrationAutodetector(object): model_state = self.to_state.models[app_label, model_name] # Are there any relationships out from this model? if so, punt it to the next phase. related_fields = [] - for field in new_app_cache.get_model(app_label, model_name)._meta.fields: + for field in new_app_cache.get_model(app_label, model_name)._meta.local_fields: if field.rel: if field.rel.to: related_fields.append((field.name, field.rel.to._meta.app_label.lower(), field.rel.to._meta.object_name.lower()))