Opened 9 years ago

Closed 9 years ago

#12291 closed (wontfix)

Order of app_store items should mirror INSTALLED_APPS

Reported by: Phui Hock Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


An app triggered _populate call (while loading apps the first time) will alter the order of the models in app_store dictionary, in a way that is different than the order as declared in INSTALLED_APPS. For example, when INSTALLED_APPS = [a, b, c], and a has a call to get_model(c.models.x), the return value of get_apps() is [a, c, b].

The order of the apps, as returned by get_apps(), should mirror INSTALLED_APPS so that the initial data (the primary keys) of auth_permission and django_content_type are not altered when new app is appended to INSTALLED_APPS.

Attachments (1) (1.1 KB) - added by Phui Hock 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Phui Hock

Attachment: added

comment:1 Changed 9 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

While we *could* do this, I'm not convinced it's desirable to do so. It suggests that the primary key values of auth_permission and django_content_type should be predicable. In the broader 'reusable app' context, this will *never* be true, so any code that is dependent on predictable ordering like this should be considered in error. Hiding the problem by making the order predictable in certain contexts would only serve to hide errors from the early phases of development that will emerge later on.

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