Ticket #2608: multilevel_fk_patch.patch

File multilevel_fk_patch.patch, 710 bytes (added by Chris Beaven, 18 years ago)

slightly simpler patch

  • django/core/management.py

     
    167167    pending_references = {}
    168168    for f in opts.fields:
    169169        if isinstance(f, (models.ForeignKey, models.OneToOneField)):
    170             rel_field = f.rel.get_related_field()
     170            # Follow keys which link to another other foreign key so we can get
     171            # the actual field type.
     172            while isinstance(f, models.ForeignKey):
     173                f = f.rel.get_related_field()
    171174            data_type = get_rel_data_type(rel_field)
    172175        else:
    173176            rel_field = f
Back to Top