mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Renamed AppCache to Apps.
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
This commit is contained in:
@@ -3,7 +3,7 @@ Module for abstract serializer/unserializer base classes.
|
||||
"""
|
||||
import warnings
|
||||
|
||||
from django.apps import app_cache
|
||||
from django.apps import apps
|
||||
from django.db import models
|
||||
from django.utils import six
|
||||
|
||||
@@ -137,9 +137,9 @@ class Deserializer(six.Iterator):
|
||||
self.stream = six.StringIO(stream_or_string)
|
||||
else:
|
||||
self.stream = stream_or_string
|
||||
# Make sure the app cache is loaded before deserialization starts
|
||||
# Make sure the app registy is loaded before deserialization starts
|
||||
# (otherwise subclass calls to get_model() and friends might fail...)
|
||||
app_cache.populate_models()
|
||||
apps.populate_models()
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
@@ -5,7 +5,7 @@ other serializers.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import app_cache
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.core.serializers import base
|
||||
from django.db import models, DEFAULT_DB_ALIAS
|
||||
@@ -88,7 +88,7 @@ def Deserializer(object_list, **options):
|
||||
db = options.pop('using', DEFAULT_DB_ALIAS)
|
||||
ignore = options.pop('ignorenonexistent', False)
|
||||
|
||||
app_cache.populate_models()
|
||||
apps.populate_models()
|
||||
|
||||
for d in object_list:
|
||||
# Look up the model and starting build a dict of data for it.
|
||||
@@ -155,7 +155,7 @@ def _get_model(model_identifier):
|
||||
Helper to look up a model from an "app_label.model_name" string.
|
||||
"""
|
||||
try:
|
||||
Model = app_cache.get_model(*model_identifier.split("."))
|
||||
Model = apps.get_model(*model_identifier.split("."))
|
||||
except TypeError:
|
||||
Model = None
|
||||
if Model is None:
|
||||
|
||||
@@ -4,7 +4,7 @@ XML serializer.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import app_cache
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.core.serializers import base
|
||||
from django.db import models, DEFAULT_DB_ALIAS
|
||||
@@ -277,7 +277,7 @@ class Deserializer(base.Deserializer):
|
||||
"<%s> node is missing the required '%s' attribute"
|
||||
% (node.nodeName, attr))
|
||||
try:
|
||||
Model = app_cache.get_model(*model_identifier.split("."))
|
||||
Model = apps.get_model(*model_identifier.split("."))
|
||||
except TypeError:
|
||||
Model = None
|
||||
if Model is None:
|
||||
|
||||
Reference in New Issue
Block a user