Opened 10 years ago
Last modified 10 years ago
#23305 closed Cleanup/optimization
Models that are imported on app's import time are invisible to makemigrations — at Version 2
Reported by: | Rafał Pitoń | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.7-rc-2 |
Severity: | Normal | Keywords: | afraid-to-commit |
Cc: | cmawebsite@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | 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.
Change History (2)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Component: | Uncategorized → Migrations |
---|---|
Description: | modified (diff) |
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 |
I've fixed your Headline and marked it as a release blocker (since I think this bug should not be in 1.7, but maybe a core could change it to the correct status.)