mirror of
https://github.com/django/django.git
synced 2025-10-05 16:20:26 +00:00
Turned apps.ready into a property. Added tests.
This commit is contained in:
parent
922430177c
commit
52325b0a04
3 changed files with 29 additions and 12 deletions
|
@ -438,7 +438,7 @@ class Options(object):
|
|||
if hasattr(f, 'related'):
|
||||
cache[f.name] = cache[f.attname] = (
|
||||
f.related, None if f.model == self.model else f.model, True, False)
|
||||
if apps.ready():
|
||||
if apps.ready:
|
||||
self._name_map = cache
|
||||
return cache
|
||||
|
||||
|
@ -564,7 +564,7 @@ class Options(object):
|
|||
and not isinstance(f.rel.to, six.string_types)
|
||||
and self == f.rel.to._meta):
|
||||
cache[f.related] = None
|
||||
if apps.ready():
|
||||
if apps.ready:
|
||||
self._related_many_to_many_cache = cache
|
||||
return cache
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue