Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed Cache to AppCache and cache_ready() to app_cache_ready() from…

… [5919] in order to avoid any potential confusion with Django's caching middleware functionality when reading the code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7969c1ba05ef342725083d060b038a8a874e69e6 1 parent a89e401
@malcolmt malcolmt authored
Showing with 7 additions and 7 deletions.
  1. +5 −5 django/db/models/loading.py
  2. +2 −2 django/db/models/options.py
View
10 django/db/models/loading.py
@@ -7,9 +7,9 @@
import threading
__all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_models',
- 'load_app', 'cache_ready')
+ 'load_app', 'app_cache_ready')
-class Cache(object):
+class AppCache(object):
"""
A cache that stores installed applications and their models. Used to
provide reverse-relations and for app introspection (e.g. admin).
@@ -85,7 +85,7 @@ def load_app(self, app_name, can_postpone=False):
self.app_store[mod.models] = len(self.app_store)
return mod.models
- def cache_ready(self):
+ def app_cache_ready(self):
"""
Returns true if the model cache is fully populated.
@@ -177,7 +177,7 @@ def register_models(self, app_label, *models):
continue
model_dict[model_name] = model
-cache = Cache()
+cache = AppCache()
# These methods were always module level, so are kept that way for backwards
# compatibility.
@@ -188,4 +188,4 @@ def register_models(self, app_label, *models):
get_model = cache.get_model
register_models = cache.register_models
load_app = cache.load_app
-cache_ready = cache.cache_ready
+app_cache_ready = cache.app_cache_ready
View
4 django/db/models/options.py
@@ -2,7 +2,7 @@
from django.db.models.related import RelatedObject
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
-from django.db.models.loading import get_models, cache_ready
+from django.db.models.loading import get_models, app_cache_ready
from django.db.models.query import orderlist2sql
from django.db.models import Manager
from django.utils.translation import activate, deactivate_all, get_language, string_concat
@@ -179,7 +179,7 @@ def get_all_related_many_to_many_objects(self):
for f in klass._meta.many_to_many:
if f.rel and self == f.rel.to._meta:
rel_objs.append(RelatedObject(f.rel.to, klass, f))
- if cache_ready():
+ if app_cache_ready():
self._all_related_many_to_many_objects = rel_objs
return rel_objs

0 comments on commit 7969c1b

Please sign in to comment.
Something went wrong with that request. Please try again.