Opened 10 years ago
Last modified 10 years ago
#23358 closed Uncategorized
with nested applications different applications ordering cause wrong app_label for some models — at Version 4
Reported by: | Raffaele Salmaso | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | raffaele.salmaso@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I've a project with this layout
project project.myapp ... # other apps
project
and project.myapp
have both models.py
project.myapp.models
has MyModel
defined
If I have
INSTALLED_APPS = (
'project.myapp',
'project',
)
django recognize project.myapp.models.MyModel
correctly as myapp.MyModel
.
otherwise if I have
INSTALLED_APPS = (
'project',
'project.myapp',
)
django recognize project.myapp.models.MyModel
incorrectly as project.MyModel
.
Change History (4)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Yes, I mean 'incorrectly'.
I'm porting a large project already in production to 1.7 so probably there is some import left, I'll check if it's the same issue of https://code.djangoproject.com/ticket/23348.
I say "migrations" because I find the problem with makemigrations
, and only one app is misbehaving, the others are fine (all nested).
comment:3 by , 10 years ago
Summary: | migrations → with nested applications different applications ordering cause wrong app_label for some models |
---|
comment:4 by , 10 years ago
Description: | modified (diff) |
---|
I assume you meant "incorrectly" in the last line. If so, that's probably the same issue as #23348. Make sure your
project
app doesn't import models fromproject.myapp
.Your title says "migrations" but I'm not sure how this is related to migrations.