Opened 10 years ago

Closed 10 years ago

#23358 closed Uncategorized (invalid)

with nested applications different applications ordering cause wrong app_label for some models

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 Raffaele Salmaso)

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 (6)

comment:1 by Aymeric Augustin, 10 years ago

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 from project.myapp.

Your title says "migrations" but I'm not sure how this is related to migrations.

comment:2 by Raffaele Salmaso, 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 Raffaele Salmaso, 10 years ago

Summary: migrationswith nested applications different applications ordering cause wrong app_label for some models

comment:4 by Raffaele Salmaso, 10 years ago

Description: modified (diff)

comment:5 by Raffaele Salmaso, 10 years ago

Ops, update title with correct string, was left stub title

comment:6 by Raffaele Salmaso, 10 years ago

Resolution: invalid
Status: newclosed

Yep, that was the problem.

Close the ticket as invalid.

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