summaryrefslogtreecommitdiff
path: root/django/apps
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 15:04:58 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 15:04:58 +0100
commit52325b0a04cf1fcf444cece197585a35cf65bab9 (patch)
treea8c8637d54d056eff76b70a11412e4fc6030c5d9 /django/apps
parent922430177ccdaed2561ec442a76de3eb89ae88a0 (diff)
downloaddjango-52325b0a04cf1fcf444cece197585a35cf65bab9.tar.gz
Turned apps.ready into a property. Added tests.
Diffstat (limited to 'django/apps')
-rw-r--r--django/apps/registry.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 2a09513152..e39fb43fa4 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -138,9 +138,10 @@ class Apps(object):
self.get_models.cache_clear()
self._models_loaded = True
+ @property
def ready(self):
"""
- Returns True if the registry is fully populated.
+ Whether the registry is fully populated.
Useful for code that wants to cache the results of get_models() for
themselves once it is safe to do so.
@@ -378,9 +379,9 @@ class Apps(object):
def app_cache_ready(self):
warnings.warn(
- "app_cache_ready() is deprecated.",
+ "app_cache_ready() is deprecated in favor of the ready property.",
PendingDeprecationWarning, stacklevel=2)
- return self.ready()
+ return self.ready
def get_app(self, app_label):
"""