2013-12-12 04:44:27 +08:00
|
|
|
import warnings
|
2006-05-02 09:31:56 +08:00
|
|
|
|
2013-12-24 19:25:17 +08:00
|
|
|
from django.apps import apps
|
2013-07-29 21:50:58 +08:00
|
|
|
|
2013-12-12 04:44:27 +08:00
|
|
|
warnings.warn(
|
|
|
|
"The utilities in django.db.models.loading are deprecated "
|
|
|
|
"in favor of the new application loading system.",
|
|
|
|
PendingDeprecationWarning, stacklevel=2)
|
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
|
|
|
|
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.
|
2013-12-24 19:25:17 +08:00
|
|
|
get_apps = apps.get_apps
|
|
|
|
get_app_package = apps.get_app_package
|
|
|
|
get_app_path = apps.get_app_path
|
|
|
|
get_app_paths = apps.get_app_paths
|
|
|
|
get_app = apps.get_app
|
|
|
|
get_models = apps.get_models
|
|
|
|
get_model = apps.get_model
|
|
|
|
register_models = apps.register_models
|
|
|
|
load_app = apps.load_app
|
|
|
|
app_cache_ready = apps.ready
|
2013-12-12 18:36:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
# This method doesn't return anything interesting in Django 1.6. Maintain it
|
|
|
|
# just for backwards compatibility until this module is deprecated.
|
|
|
|
def get_app_errors():
|
|
|
|
try:
|
2013-12-24 19:25:17 +08:00
|
|
|
return apps.app_errors
|
2013-12-12 18:36:40 +08:00
|
|
|
except AttributeError:
|
2013-12-24 19:25:17 +08:00
|
|
|
apps.populate_models()
|
|
|
|
apps.app_errors = {}
|
|
|
|
return apps.app_errors
|