﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22758	Makemigrations puts subclasses of abstract models in the wrong app	Craig de Stigter	Aymeric Augustin	"If I define a concrete model that inherits an abstract base from a different app, like so:
{{{
#!python
class AbstractModel(models.Model):
    a = models.CharField(max_length=100)

    class Meta:
        abstract = True
        app_label = 'otherapp'


class MyModel(AbstractModel):
    b = models.CharField(max_length=255)
}}}

Then makemigrations tells me nothing has changed.
{{{
#!bash
$ ./manage.py makemigrations foo
No changes detected in app 'foo'
}}}

Because it's assigned my model to the app containing the abstract class:

{{{
#!bash
$ ./manage.py makemigrations otherapp
Migrations for 'otherapp':
  0002_auto_20140603_2330.py:
    - Create model MyModel
}}}

There is a workaround: If I instead explicitly supply `app_label` on my model it works as expected:

{{{
#!python
class MyModel(AbstractModel):
    b = models.CharField(max_length=255)

    class Meta:
        app_label = 'foo'
}}}

{{{
#!bash
$ ./manage.py makemigrations foo
Migrations for 'foo':
  0001_initial.py:
    - Create model MyModel
}}}"	Bug	closed	Core (Other)	1.7-beta-2	Release blocker	invalid	app-loading		Unreviewed	0	0	0	0	0	0
