1
0
mirror of https://github.com/django/django.git synced 2025-03-31 19:46:42 +00:00
django/django/db/models/loading.py
Aymeric Augustin d44de9b933 Removed the _-prefix for populate().
Several parts of Django call get_apps() with a comment along this lines
of "this has the side effect of calling _populate()". I fail to see how
this is better than just calling populate()!
2013-12-17 10:17:45 +01:00

36 lines
1.1 KiB
Python

import warnings
from django.apps import app_cache
warnings.warn(
"The utilities in django.db.models.loading are deprecated "
"in favor of the new application loading system.",
PendingDeprecationWarning, stacklevel=2)
__all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_models',
'load_app', 'app_cache_ready')
# These methods were always module level, so are kept that way for backwards
# compatibility.
get_apps = app_cache.get_apps
get_app_package = app_cache.get_app_package
get_app_path = app_cache.get_app_path
get_app_paths = app_cache.get_app_paths
get_app = app_cache.get_app
get_models = app_cache.get_models
get_model = app_cache.get_model
register_models = app_cache.register_models
load_app = app_cache.load_app
app_cache_ready = app_cache.app_cache_ready
# 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:
return app_cache.app_errors
except AttributeError:
app_cache.populate()
app_cache.app_errors = {}
return app_cache.app_errors