Opened 16 years ago

Closed 15 years ago

#7538 closed (wontfix)

add signal when all models are loaded

Reported by: django@… Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently there is no signal when the models cache is fully populated.
I wrote a widget framework which loads widgets from the installed apps. Currently there is no hook to use to initialize additional models after all models are loaded. We run in many strange problems because the widgets may import models itself.

patch adds a modules_loaded signal which is fired after the AppCache populated the cache completely, allows many nice things to be done after the app started completly.

Attachments (1)

django_models_loaded_signal.patch (1.1 KB ) - added by django@… 16 years ago.
adds models_loaded signal

Download all attachments as: .zip

Change History (8)

by django@…, 16 years ago

adds models_loaded signal

comment:1 by Marc Garcia, 16 years ago

milestone: 1.0 alphapost-1.0

According to ticket organization defined in 1.0 alpha tickets should be just features in the Must have ( list.

Change to 1.0 beta if you can make this feature be added to May be features (

comment:2 by Daniel Poelzleithner, 16 years ago

milestone: post-1.01.0 beta

sorry, but i have to disagree. the django model loader is very nice but often causes problems when doing non standard things. this signal is absolutely non invasive. can't cause problems in any way and is minimal in overhead. the gain is much wider then the cost.

comment:3 by Russell Keith-Magee, 16 years ago

milestone: 1.0 beta

This is a feature request that has had no discussion on Django developers. It isn't a candidate for v1.0.

comment:4 by Eric Holscher, 16 years ago

milestone: post-1.0
Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedDesign decision needed

comment:5 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:6 by anonymous, 15 years ago

Cc: polarcowz@… added

comment:7 by DanielLindsley, 15 years ago

Cc: polarcowz@… removed
Resolution: wontfix
Status: newclosed

After some short discussion on the list and further explanation by Malcolm, this patch does not work the way Django works and is far too specific to the AppCache, which should remain an internal implementation detail. Models are not loaded at any one specific point in Django; rather, they are loaded the first time a Model is attempted to be imported. Because of this you would never be guaranteed of this always behaving the same way. Further, there is the potential in the future that Django would enable partial loading (only the models necessary), rendering this behavior useless.

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