Opened 8 months ago

Closed 8 months ago

#23358 closed Uncategorized (invalid)

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

Reported by: rsalmaso Owned by: nobody
Component: Migrations Version: master
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 rsalmaso)

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 Changed 8 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 8 months ago by rsalmaso

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 Changed 8 months ago by rsalmaso

  • Summary changed from migrations to with nested applications different applications ordering cause wrong app_label for some models

comment:4 Changed 8 months ago by rsalmaso

  • Description modified (diff)

comment:5 Changed 8 months ago by rsalmaso

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

comment:6 Changed 8 months ago by rsalmaso

  • Resolution set to invalid
  • Status changed from new to closed

Yep, that was the problem.

Close the ticket as invalid.

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