Index: django/core/management.py =================================================================== --- django/core/management.py (revision 3608) +++ django/core/management.py (working copy) @@ -148,7 +148,10 @@ pending_references = {} for f in opts.fields: if isinstance(f, models.ForeignKey): - rel_field = f.rel.get_related_field() + fld = f + while isinstance(fld, models.ForeignKey): + rel_field = fld.rel.get_related_field() + fld = rel_field data_type = get_rel_data_type(rel_field) else: rel_field = f