1
0
mirror of https://github.com/django/django.git synced 2025-10-27 23:56:08 +00:00

Refs #23919 -- Stopped using django.utils.lru_cache().

This commit is contained in:
Aymeric Augustin
2017-01-18 21:30:21 +01:00
committed by Tim Graham
parent 2b281cc35e
commit 3cc5f01d9b
21 changed files with 52 additions and 216 deletions

View File

@@ -1,3 +1,4 @@
import functools
import sys
import threading
import warnings
@@ -5,7 +6,6 @@ from collections import Counter, OrderedDict, defaultdict
from functools import partial
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils import lru_cache
from .config import AppConfig
@@ -156,7 +156,7 @@ class Apps(object):
raise LookupError(message)
# This method is performance-critical at least for Django's test suite.
@lru_cache.lru_cache(maxsize=None)
@functools.lru_cache(maxsize=None)
def get_models(self, include_auto_created=False, include_swapped=False):
"""
Returns a list of all installed models.
@@ -268,7 +268,7 @@ class Apps(object):
"Model '%s.%s' not registered." % (app_label, model_name))
return model
@lru_cache.lru_cache(maxsize=None)
@functools.lru_cache(maxsize=None)
def get_swappable_settings_name(self, to_string):
"""
For a given model string (e.g. "auth.User"), return the name of the