Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

send a app_cache_ready signal when the app cache is ready.

  • Loading branch information...
commit cfa687409698ab9c5ffd150d0c89aba7d361739f 1 parent 74860f6
@craigds craigds authored
Showing with 3 additions and 0 deletions.
  1. +2 −0  django/db/models/loading.py
  2. +1 −0  django/db/models/signals.py
View
2  django/db/models/loading.py
@@ -2,6 +2,7 @@
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
+from django.db.models.signals import app_cache_ready as app_cache_ready_signal
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
@@ -73,6 +74,7 @@ def _populate(self):
for app_name in self.postponed:
self.load_app(app_name)
self.loaded = True
+ app_cache_ready_signal.send(sender=self)
finally:
imp.release_lock()
View
1  django/db/models/signals.py
@@ -1,6 +1,7 @@
from django.dispatch import Signal
class_prepared = Signal(providing_args=["class"])
+app_cache_ready = Signal()
pre_init = Signal(providing_args=["instance", "args", "kwargs"])
post_init = Signal(providing_args=["instance"])
Please sign in to comment.
Something went wrong with that request. Please try again.