2006-05-02 09:31:56 +08:00
|
|
|
"Utilities for loading models and the modules that contain them."
|
|
|
|
|
2013-08-03 13:41:15 +08:00
|
|
|
from collections import OrderedDict
|
|
|
|
import copy
|
2013-07-29 21:50:58 +08:00
|
|
|
import imp
|
|
|
|
from importlib import import_module
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2006-05-02 09:31:56 +08:00
|
|
|
from django.conf import settings
|
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
2010-04-16 02:44:51 +08:00
|
|
|
from django.utils.module_loading import module_has_submodule
|
2012-12-08 18:13:52 +08:00
|
|
|
from django.utils._os import upath
|
2012-07-21 03:14:27 +08:00
|
|
|
from django.utils import six
|
2008-06-22 04:55:17 +08:00
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
__all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_models',
|
2007-08-18 12:16:04 +08:00
|
|
|
'load_app', 'app_cache_ready')
|
2006-07-30 05:04:41 +08:00
|
|
|
|
2013-07-17 01:21:17 +08:00
|
|
|
MODELS_MODULE_NAME = 'models'
|
|
|
|
|
2013-08-03 13:41:15 +08:00
|
|
|
class ModelDict(OrderedDict):
|
|
|
|
"""
|
|
|
|
We need to special-case the deepcopy for this, as the keys are modules,
|
|
|
|
which can't be deep copied.
|
|
|
|
"""
|
|
|
|
def __deepcopy__(self, memo):
|
|
|
|
return self.__class__([(key, copy.deepcopy(value, memo))
|
|
|
|
for key, value in self.items()])
|
2013-07-08 08:39:54 +08:00
|
|
|
|
2013-06-04 14:13:36 +08:00
|
|
|
class UnavailableApp(Exception):
|
|
|
|
pass
|
2012-09-22 06:36:26 +08:00
|
|
|
|
2013-07-08 08:39:54 +08:00
|
|
|
|
2013-05-09 22:16:43 +08:00
|
|
|
def _initialize():
|
2006-05-02 09:31:56 +08:00
|
|
|
"""
|
2013-05-09 22:16:43 +08:00
|
|
|
Returns a dictionary to be used as the initial value of the
|
|
|
|
[shared] state of the app cache.
|
2006-05-02 09:31:56 +08:00
|
|
|
"""
|
2013-05-09 22:16:43 +08:00
|
|
|
return dict(
|
2012-09-22 06:36:26 +08:00
|
|
|
# Keys of app_store are the model modules for each application.
|
2013-08-03 13:41:15 +08:00
|
|
|
app_store=ModelDict(),
|
2013-05-09 22:16:43 +08:00
|
|
|
|
2011-04-21 01:58:37 +08:00
|
|
|
# Mapping of installed app_labels to model modules for that app.
|
2013-05-09 22:16:43 +08:00
|
|
|
app_labels = {},
|
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
# Mapping of app_labels to a dictionary of model names to model code.
|
2011-04-21 01:58:37 +08:00
|
|
|
# May contain apps that are not installed.
|
2013-08-03 13:41:15 +08:00
|
|
|
app_models=ModelDict(),
|
2013-05-09 22:16:43 +08:00
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
# Mapping of app_labels to errors raised when trying to import the app.
|
2013-05-09 22:16:43 +08:00
|
|
|
app_errors = {},
|
|
|
|
|
2013-05-09 22:59:26 +08:00
|
|
|
# Pending lookups for lazy relations
|
|
|
|
pending_lookups = {},
|
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
# -- Everything below here is only used when populating the cache --
|
2013-05-09 22:59:26 +08:00
|
|
|
loads_installed = True,
|
2012-11-24 13:43:20 +08:00
|
|
|
loaded=False,
|
2013-06-09 20:31:04 +08:00
|
|
|
handled=set(),
|
2012-11-24 13:43:20 +08:00
|
|
|
postponed=[],
|
|
|
|
nesting_level=0,
|
|
|
|
_get_models_cache={},
|
2013-06-04 14:13:36 +08:00
|
|
|
available_apps=None,
|
2013-05-09 22:16:43 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class BaseAppCache(object):
|
|
|
|
"""
|
|
|
|
A cache that stores installed applications and their models. Used to
|
|
|
|
provide reverse-relations and for app introspection (e.g. admin).
|
|
|
|
|
|
|
|
This provides the base (non-Borg) AppCache class - the AppCache
|
|
|
|
subclass adds borg-like behaviour for the few cases where it's needed,
|
|
|
|
and adds the code that auto-loads from INSTALLED_APPS.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
self.__dict__ = _initialize()
|
2013-05-09 22:59:26 +08:00
|
|
|
# This stops _populate loading from INSTALLED_APPS and ignores the
|
|
|
|
# only_installed arguments to get_model[s]
|
|
|
|
self.loads_installed = False
|
2007-08-18 01:23:15 +08:00
|
|
|
|
|
|
|
def _populate(self):
|
|
|
|
"""
|
2013-05-09 22:16:43 +08:00
|
|
|
Stub method - this base class does no auto-loading.
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
2013-05-09 22:59:26 +08:00
|
|
|
"""
|
|
|
|
Fill in all the cache information. This method is threadsafe, in the
|
|
|
|
sense that every caller will see the same state upon return, and if the
|
|
|
|
cache is already initialised, it does no work.
|
|
|
|
"""
|
|
|
|
if self.loaded:
|
|
|
|
return
|
|
|
|
if not self.loads_installed:
|
|
|
|
self.loaded = True
|
|
|
|
return
|
|
|
|
# Note that we want to use the import lock here - the app loading is
|
|
|
|
# in many cases initiated implicitly by importing, and thus it is
|
|
|
|
# possible to end up in deadlock when one thread initiates loading
|
|
|
|
# without holding the importer lock and another thread then tries to
|
|
|
|
# import something which also launches the app loading. For details of
|
|
|
|
# this situation see #18251.
|
|
|
|
imp.acquire_lock()
|
|
|
|
try:
|
|
|
|
if self.loaded:
|
|
|
|
return
|
|
|
|
for app_name in settings.INSTALLED_APPS:
|
|
|
|
if app_name in self.handled:
|
|
|
|
continue
|
|
|
|
self.load_app(app_name, True)
|
|
|
|
if not self.nesting_level:
|
|
|
|
for app_name in self.postponed:
|
|
|
|
self.load_app(app_name)
|
|
|
|
self.loaded = True
|
|
|
|
finally:
|
|
|
|
imp.release_lock()
|
2007-08-18 01:23:15 +08:00
|
|
|
|
2011-04-21 01:58:37 +08:00
|
|
|
def _label_for(self, app_mod):
|
|
|
|
"""
|
|
|
|
Return app_label for given models module.
|
|
|
|
|
|
|
|
"""
|
|
|
|
return app_mod.__name__.split('.')[-2]
|
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
def load_app(self, app_name, can_postpone=False):
|
|
|
|
"""
|
|
|
|
Loads the app with the provided fully qualified name, and returns the
|
|
|
|
model module.
|
|
|
|
"""
|
2013-08-06 01:34:35 +08:00
|
|
|
app_module = import_module(app_name)
|
2013-06-09 20:31:04 +08:00
|
|
|
self.handled.add(app_name)
|
2007-08-18 01:23:15 +08:00
|
|
|
self.nesting_level += 1
|
2010-04-15 03:10:27 +08:00
|
|
|
try:
|
2013-07-29 21:50:58 +08:00
|
|
|
models = import_module('%s.%s' % (app_name, MODELS_MODULE_NAME))
|
2009-03-19 00:55:59 +08:00
|
|
|
except ImportError:
|
|
|
|
self.nesting_level -= 1
|
2010-04-16 02:44:51 +08:00
|
|
|
# If the app doesn't have a models module, we can just ignore the
|
|
|
|
# ImportError and return no models for it.
|
2013-07-17 01:21:17 +08:00
|
|
|
if not module_has_submodule(app_module, MODELS_MODULE_NAME):
|
2010-04-15 03:10:27 +08:00
|
|
|
return None
|
2010-04-16 02:44:51 +08:00
|
|
|
# But if the app does have a models module, we need to figure out
|
|
|
|
# whether to suppress or propagate the error. If can_postpone is
|
|
|
|
# True then it may be that the package is still being imported by
|
|
|
|
# Python and the models module isn't available yet. So we add the
|
|
|
|
# app to the postponed list and we'll try it again after all the
|
|
|
|
# recursion has finished (in populate). If can_postpone is False
|
|
|
|
# then it's time to raise the ImportError.
|
2010-04-15 03:10:27 +08:00
|
|
|
else:
|
2010-04-16 02:44:51 +08:00
|
|
|
if can_postpone:
|
|
|
|
self.postponed.append(app_name)
|
|
|
|
return None
|
|
|
|
else:
|
|
|
|
raise
|
|
|
|
|
2009-03-19 00:55:59 +08:00
|
|
|
self.nesting_level -= 1
|
|
|
|
if models not in self.app_store:
|
|
|
|
self.app_store[models] = len(self.app_store)
|
2011-04-21 01:58:37 +08:00
|
|
|
self.app_labels[self._label_for(models)] = models
|
2009-03-19 00:55:59 +08:00
|
|
|
return models
|
2007-08-18 01:23:15 +08:00
|
|
|
|
2007-08-18 12:16:04 +08:00
|
|
|
def app_cache_ready(self):
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
|
|
|
Returns true if the model cache is fully populated.
|
|
|
|
|
|
|
|
Useful for code that wants to cache the results of get_models() for
|
|
|
|
themselves once it is safe to do so.
|
|
|
|
"""
|
|
|
|
return self.loaded
|
|
|
|
|
|
|
|
def get_apps(self):
|
2013-06-02 16:13:54 +08:00
|
|
|
"""
|
|
|
|
Returns a list of all installed modules that contain models.
|
|
|
|
"""
|
2007-08-18 01:23:15 +08:00
|
|
|
self._populate()
|
|
|
|
|
2013-06-04 14:13:36 +08:00
|
|
|
apps = self.app_store.items()
|
|
|
|
if self.available_apps is not None:
|
|
|
|
apps = [elt for elt in apps
|
|
|
|
if self._label_for(elt[0]) in self.available_apps]
|
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
# Ensure the returned list is always in the same order (with new apps
|
|
|
|
# added at the end). This avoids unstable ordering on the admin app
|
|
|
|
# list page, for example.
|
2013-06-04 14:13:36 +08:00
|
|
|
apps = sorted(apps, key=lambda elt: elt[1])
|
|
|
|
|
|
|
|
return [elt[0] for elt in apps]
|
2007-08-18 01:23:15 +08:00
|
|
|
|
2013-10-19 08:24:38 +08:00
|
|
|
def _get_app_package(self, app):
|
|
|
|
return '.'.join(app.__name__.split('.')[:-1])
|
|
|
|
|
|
|
|
def get_app_package(self, app_label):
|
|
|
|
return self._get_app_package(self.get_app(app_label))
|
|
|
|
|
2013-07-16 21:10:04 +08:00
|
|
|
def _get_app_path(self, app):
|
|
|
|
if hasattr(app, '__path__'): # models/__init__.py package
|
|
|
|
app_path = app.__path__[0]
|
|
|
|
else: # models.py module
|
|
|
|
app_path = app.__file__
|
|
|
|
return os.path.dirname(upath(app_path))
|
|
|
|
|
|
|
|
def get_app_path(self, app_label):
|
|
|
|
return self._get_app_path(self.get_app(app_label))
|
|
|
|
|
2013-06-02 16:13:54 +08:00
|
|
|
def get_app_paths(self):
|
|
|
|
"""
|
|
|
|
Returns a list of paths to all installed apps.
|
|
|
|
|
|
|
|
Useful for discovering files at conventional locations inside apps
|
|
|
|
(static files, templates, etc.)
|
|
|
|
"""
|
|
|
|
self._populate()
|
|
|
|
|
|
|
|
app_paths = []
|
|
|
|
for app in self.get_apps():
|
2013-07-16 21:10:04 +08:00
|
|
|
app_paths.append(self._get_app_path(app))
|
2013-06-02 16:13:54 +08:00
|
|
|
return app_paths
|
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
def get_app(self, app_label, emptyOK=False):
|
|
|
|
"""
|
2013-06-04 14:13:36 +08:00
|
|
|
Returns the module containing the models for the given app_label.
|
|
|
|
|
|
|
|
Returns None if the app has no models in it and emptyOK is True.
|
|
|
|
|
|
|
|
Raises UnavailableApp when set_available_apps() in in effect and
|
|
|
|
doesn't include app_label.
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
|
|
|
self._populate()
|
2012-05-12 00:41:47 +08:00
|
|
|
imp.acquire_lock()
|
|
|
|
try:
|
2007-08-18 01:23:15 +08:00
|
|
|
for app_name in settings.INSTALLED_APPS:
|
|
|
|
if app_label == app_name.split('.')[-1]:
|
|
|
|
mod = self.load_app(app_name, False)
|
2013-06-04 14:13:36 +08:00
|
|
|
if mod is None and not emptyOK:
|
2011-09-23 05:09:00 +08:00
|
|
|
raise ImproperlyConfigured("App with label %s is missing a models.py module." % app_label)
|
2013-06-04 14:13:36 +08:00
|
|
|
if self.available_apps is not None and app_label not in self.available_apps:
|
|
|
|
raise UnavailableApp("App with label %s isn't available." % app_label)
|
|
|
|
return mod
|
2010-01-11 02:36:20 +08:00
|
|
|
raise ImproperlyConfigured("App with label %s could not be found" % app_label)
|
2012-05-12 00:41:47 +08:00
|
|
|
finally:
|
|
|
|
imp.release_lock()
|
2007-08-18 01:23:15 +08:00
|
|
|
|
|
|
|
def get_app_errors(self):
|
|
|
|
"Returns the map of known problems with the INSTALLED_APPS."
|
|
|
|
self._populate()
|
|
|
|
return self.app_errors
|
|
|
|
|
2011-04-21 01:58:37 +08:00
|
|
|
def get_models(self, app_mod=None,
|
2011-04-27 23:46:43 +08:00
|
|
|
include_auto_created=False, include_deferred=False,
|
2012-11-24 13:43:20 +08:00
|
|
|
only_installed=True, include_swapped=False):
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
|
|
|
Given a module containing models, returns a list of the models.
|
|
|
|
Otherwise returns a list of all installed models.
|
2009-11-03 22:02:49 +08:00
|
|
|
|
|
|
|
By default, auto-created models (i.e., m2m models without an
|
|
|
|
explicit intermediate table) are not included. However, if you
|
|
|
|
specify include_auto_created=True, they will be.
|
2009-12-22 14:01:23 +08:00
|
|
|
|
|
|
|
By default, models created to satisfy deferred attribute
|
|
|
|
queries are *not* included in the list of models. However, if
|
|
|
|
you specify include_deferred, they will be.
|
2012-11-24 13:43:20 +08:00
|
|
|
|
|
|
|
By default, models that aren't part of installed apps will *not*
|
|
|
|
be included in the list of models. However, if you specify
|
2013-05-09 22:59:26 +08:00
|
|
|
only_installed=False, they will be. If you're using a non-default
|
|
|
|
AppCache, this argument does nothing - all models will be included.
|
2012-11-24 13:43:20 +08:00
|
|
|
|
|
|
|
By default, models that have been swapped out will *not* be
|
|
|
|
included in the list of models. However, if you specify
|
|
|
|
include_swapped, they will be.
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
2013-05-09 22:59:26 +08:00
|
|
|
if not self.loads_installed:
|
|
|
|
only_installed = False
|
2012-11-24 13:43:20 +08:00
|
|
|
cache_key = (app_mod, include_auto_created, include_deferred, only_installed, include_swapped)
|
2013-06-04 14:13:36 +08:00
|
|
|
model_list = None
|
2009-12-17 05:25:00 +08:00
|
|
|
try:
|
2013-06-04 14:13:36 +08:00
|
|
|
model_list = self._get_models_cache[cache_key]
|
|
|
|
if self.available_apps is not None and only_installed:
|
|
|
|
model_list = [m for m in model_list
|
|
|
|
if m._meta.app_label in self.available_apps]
|
|
|
|
return model_list
|
2009-12-17 05:25:00 +08:00
|
|
|
except KeyError:
|
|
|
|
pass
|
2007-08-18 01:23:15 +08:00
|
|
|
self._populate()
|
|
|
|
if app_mod:
|
2011-04-21 01:58:37 +08:00
|
|
|
if app_mod in self.app_store:
|
|
|
|
app_list = [self.app_models.get(self._label_for(app_mod),
|
2013-08-03 13:41:15 +08:00
|
|
|
ModelDict())]
|
2011-04-21 01:58:37 +08:00
|
|
|
else:
|
|
|
|
app_list = []
|
2007-08-18 01:23:15 +08:00
|
|
|
else:
|
2011-04-27 23:46:43 +08:00
|
|
|
if only_installed:
|
2013-08-03 13:41:15 +08:00
|
|
|
app_list = [self.app_models.get(app_label, ModelDict())
|
2012-07-21 03:14:27 +08:00
|
|
|
for app_label in six.iterkeys(self.app_labels)]
|
2011-04-27 23:46:43 +08:00
|
|
|
else:
|
2012-07-21 03:14:27 +08:00
|
|
|
app_list = six.itervalues(self.app_models)
|
2009-12-22 14:01:23 +08:00
|
|
|
model_list = []
|
|
|
|
for app in app_list:
|
|
|
|
model_list.extend(
|
|
|
|
model for model in app.values()
|
2011-04-21 01:58:37 +08:00
|
|
|
if ((not model._deferred or include_deferred) and
|
2012-11-24 13:43:20 +08:00
|
|
|
(not model._meta.auto_created or include_auto_created) and
|
|
|
|
(not model._meta.swapped or include_swapped))
|
2009-12-22 14:01:23 +08:00
|
|
|
)
|
2009-12-17 05:25:00 +08:00
|
|
|
self._get_models_cache[cache_key] = model_list
|
2013-06-04 14:13:36 +08:00
|
|
|
if self.available_apps is not None and only_installed:
|
|
|
|
model_list = [m for m in model_list
|
|
|
|
if m._meta.app_label in self.available_apps]
|
2009-11-03 22:02:49 +08:00
|
|
|
return model_list
|
2007-08-18 01:23:15 +08:00
|
|
|
|
2011-04-21 01:58:37 +08:00
|
|
|
def get_model(self, app_label, model_name,
|
|
|
|
seed_cache=True, only_installed=True):
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
|
|
|
Returns the model matching the given app_label and case-insensitive
|
|
|
|
model_name.
|
|
|
|
|
|
|
|
Returns None if no model is found.
|
2013-06-04 14:13:36 +08:00
|
|
|
|
|
|
|
Raises UnavailableApp when set_available_apps() in in effect and
|
|
|
|
doesn't include app_label.
|
2007-08-18 01:23:15 +08:00
|
|
|
"""
|
2013-05-09 22:59:26 +08:00
|
|
|
if not self.loads_installed:
|
|
|
|
only_installed = False
|
2007-08-18 01:23:15 +08:00
|
|
|
if seed_cache:
|
|
|
|
self._populate()
|
2011-04-21 01:58:37 +08:00
|
|
|
if only_installed and app_label not in self.app_labels:
|
|
|
|
return None
|
2013-06-04 14:13:36 +08:00
|
|
|
if (self.available_apps is not None and only_installed
|
|
|
|
and app_label not in self.available_apps):
|
|
|
|
raise UnavailableApp("App with label %s isn't available." % app_label)
|
|
|
|
try:
|
|
|
|
return self.app_models[app_label][model_name.lower()]
|
|
|
|
except KeyError:
|
|
|
|
return None
|
2007-08-18 01:23:15 +08:00
|
|
|
|
|
|
|
def register_models(self, app_label, *models):
|
|
|
|
"""
|
|
|
|
Register a set of models as belonging to an app.
|
|
|
|
"""
|
|
|
|
for model in models:
|
|
|
|
# Store as 'name: model' pair in a dictionary
|
2008-06-17 21:58:19 +08:00
|
|
|
# in the app_models dictionary
|
2013-02-05 17:16:07 +08:00
|
|
|
model_name = model._meta.model_name
|
2013-08-03 13:41:15 +08:00
|
|
|
model_dict = self.app_models.setdefault(app_label, ModelDict())
|
2007-08-18 01:23:15 +08:00
|
|
|
if model_name in model_dict:
|
|
|
|
# The same model may be imported via different paths (e.g.
|
|
|
|
# appname.models and project.appname.models). We use the source
|
|
|
|
# filename as a means to detect identity.
|
2012-12-08 18:13:52 +08:00
|
|
|
fname1 = os.path.abspath(upath(sys.modules[model.__module__].__file__))
|
|
|
|
fname2 = os.path.abspath(upath(sys.modules[model_dict[model_name].__module__].__file__))
|
2007-08-18 01:23:15 +08:00
|
|
|
# Since the filename extension could be .py the first time and
|
|
|
|
# .pyc or .pyo the second time, ignore the extension when
|
|
|
|
# comparing.
|
|
|
|
if os.path.splitext(fname1)[0] == os.path.splitext(fname2)[0]:
|
|
|
|
continue
|
|
|
|
model_dict[model_name] = model
|
2009-12-17 05:25:00 +08:00
|
|
|
self._get_models_cache.clear()
|
2007-08-18 01:23:15 +08:00
|
|
|
|
2013-06-04 14:13:36 +08:00
|
|
|
def set_available_apps(self, available):
|
|
|
|
if not set(available).issubset(set(settings.INSTALLED_APPS)):
|
|
|
|
extra = set(available) - set(settings.INSTALLED_APPS)
|
|
|
|
raise ValueError("Available apps isn't a subset of installed "
|
|
|
|
"apps, extra apps: " + ", ".join(extra))
|
|
|
|
self.available_apps = set(app.rsplit('.', 1)[-1] for app in available)
|
|
|
|
|
|
|
|
def unset_available_apps(self):
|
|
|
|
self.available_apps = None
|
|
|
|
|
2012-09-08 00:51:11 +08:00
|
|
|
|
2013-05-09 22:16:43 +08:00
|
|
|
class AppCache(BaseAppCache):
|
2012-09-08 00:51:11 +08:00
|
|
|
"""
|
2013-05-09 22:16:43 +08:00
|
|
|
A cache that stores installed applications and their models. Used to
|
|
|
|
provide reverse-relations and for app introspection (e.g. admin).
|
2012-09-08 00:51:11 +08:00
|
|
|
|
2013-05-09 22:16:43 +08:00
|
|
|
Borg version of the BaseAppCache class.
|
|
|
|
"""
|
2012-09-22 07:47:04 +08:00
|
|
|
|
2013-05-09 22:16:43 +08:00
|
|
|
__shared_state = _initialize()
|
2012-09-08 00:51:11 +08:00
|
|
|
|
2013-05-09 22:16:43 +08:00
|
|
|
def __init__(self):
|
|
|
|
self.__dict__ = self.__shared_state
|
2012-09-22 07:47:04 +08:00
|
|
|
|
2013-06-19 19:03:20 +08:00
|
|
|
|
2013-05-09 22:16:43 +08:00
|
|
|
cache = AppCache()
|
2012-09-08 00:51:11 +08:00
|
|
|
|
2007-08-18 01:23:15 +08:00
|
|
|
|
|
|
|
# These methods were always module level, so are kept that way for backwards
|
2013-05-09 22:16:43 +08:00
|
|
|
# compatibility.
|
|
|
|
get_apps = cache.get_apps
|
2013-10-19 08:24:38 +08:00
|
|
|
get_app_package = cache.get_app_package
|
2013-07-16 21:10:04 +08:00
|
|
|
get_app_path = cache.get_app_path
|
2013-06-02 16:13:54 +08:00
|
|
|
get_app_paths = cache.get_app_paths
|
2013-05-09 22:16:43 +08:00
|
|
|
get_app = cache.get_app
|
|
|
|
get_app_errors = cache.get_app_errors
|
|
|
|
get_models = cache.get_models
|
|
|
|
get_model = cache.get_model
|
|
|
|
register_models = cache.register_models
|
|
|
|
load_app = cache.load_app
|
|
|
|
app_cache_ready = cache.app_cache_ready
|