Opened 15 years ago
Closed 15 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 |
Description
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)
Change History (2)
by , 15 years ago
Attachment: | loading.py.diff added |
---|
comment:1 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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.