mirror of
https://github.com/django/django.git
synced 2025-08-08 04:48:27 +00:00
Refs #23919 -- Stopped using django.utils.lru_cache().
This commit is contained in:
parent
2b281cc35e
commit
3cc5f01d9b
21 changed files with 52 additions and 216 deletions
|
@ -5,12 +5,12 @@ Factored out from django.db.models.query to avoid making the main module very
|
|||
large and/or so that they can be used by other modules without getting into
|
||||
circular import difficulties.
|
||||
"""
|
||||
import functools
|
||||
import inspect
|
||||
from collections import namedtuple
|
||||
|
||||
from django.db.models.constants import LOOKUP_SEP
|
||||
from django.utils import tree
|
||||
from django.utils.lru_cache import lru_cache
|
||||
|
||||
# PathInfo is used when converting lookups (fk__somecol). The contents
|
||||
# describe the relation in Model terms (model Options and Fields for both
|
||||
|
@ -137,7 +137,7 @@ class RegisterLookupMixin(object):
|
|||
return cls.get_lookups().get(lookup_name, None)
|
||||
|
||||
@classmethod
|
||||
@lru_cache(maxsize=None)
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def get_lookups(cls):
|
||||
class_lookups = [parent.__dict__.get('class_lookups', {}) for parent in inspect.getmro(cls)]
|
||||
return cls.merge_dicts(class_lookups)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue