Opened 9 years ago

Last modified 9 years ago

#26186 closed Bug

When extending from abstract model, ForeignKey points to wrong application — at Initial Version

Reported by: skyjur Owned by: nobody
Component: Database layer (models, ORM) Version: 1.9
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This might be related to https://code.djangoproject.com/ticket/25858

I have following code:

app_A/models.py:

class AbstractModel1(Model):
    class Meta:
        abstract = True


class AbstractModel2(Model):
    model1 = ForeignKey('Model1')

    class Meta:
          abstract = True


class Model1(AbstractModel1):
    pass

class Model2(AbstractModel12):
    pass

app_B/models.py:

from app_A.models import AbstractModel1, AbstractModel2

class Model1(AbstractModel1):
    pass

class Model2(AbstractModel12):
    pass

in Django 1.8, the app_B.Model2.model1 would point to app_B.Model1, but in Django 1.9.2 it points to app_A.Model1 so my code no longer works.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top