Models that are imported on app's import time are invisible to makemigrations when the application is relabeld
|Reported by:||rafalp||Owned by:||Bryce Caine|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
Models that are imported in app's
__init__.py, or by modules imported from that become invisible for Django if app uses apps.py and AppConfig.
To reproduce it create app with basic config and simple model in models.py. If this model is imported inside
__init__.py, or other module imported in
__init__.py, it will become invisible to makemigrations.
Tried this both with default_app_config as well as giving full path to AppConfig in INSTALLED_APPS.
I'm running latest code from 1.7 branch.
EDIT by (c-schmitt): This Bug Report only works when you import an Model in
__init__.py and relabel your application in AppConfig.
I attached a Test that could be applied to
stable/1.7.x and the user that submitted the bug also has an example application on github.
Change History (22)
comment:2 Changed 3 years ago by
|Component:||Uncategorized → Migrations|
|Severity:||Normal → Release blocker|
|Summary:||Models that are imported on app's import time are invisible to makemessages → Models that are imported on app's import time are invisible to makemigrations|
comment:8 Changed 3 years ago by
|Summary:||Models that are imported on app's import time are invisible to makemigrations → Models that are imported on app's import time are invisible to makemigrations when the application is relabeld|
comment:14 Changed 3 years ago by
|Component:||Migrations → Documentation|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Bug → Cleanup/optimization|