mirror of https://github.com/django/django.git
Refs #15093 -- Fixed another get_models call missed in r16053. Thanks Luke for catching it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16108 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
04654e554f
commit
2706fdbc87
|
@ -420,7 +420,7 @@ class Options(object):
|
||||||
cache[obj] = parent
|
cache[obj] = parent
|
||||||
else:
|
else:
|
||||||
cache[obj] = model
|
cache[obj] = model
|
||||||
for klass in get_models():
|
for klass in get_models(only_installed=False):
|
||||||
for f in klass._meta.local_many_to_many:
|
for f in klass._meta.local_many_to_many:
|
||||||
if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
|
if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
|
||||||
cache[RelatedObject(f.rel.to, klass, f)] = None
|
cache[RelatedObject(f.rel.to, klass, f)] = None
|
||||||
|
|
|
@ -7,3 +7,7 @@ class NotInstalledModel(models.Model):
|
||||||
|
|
||||||
class RelatedModel(models.Model):
|
class RelatedModel(models.Model):
|
||||||
not_installed = models.ForeignKey(NotInstalledModel)
|
not_installed = models.ForeignKey(NotInstalledModel)
|
||||||
|
|
||||||
|
|
||||||
|
class M2MRelatedModel(models.Model):
|
||||||
|
not_installed = models.ManyToManyField(NotInstalledModel)
|
||||||
|
|
|
@ -122,4 +122,4 @@ class NotInstalledModelsTest(TestCase):
|
||||||
from .not_installed.models import NotInstalledModel
|
from .not_installed.models import NotInstalledModel
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
set(NotInstalledModel._meta.get_all_field_names()),
|
set(NotInstalledModel._meta.get_all_field_names()),
|
||||||
set(["id", "relatedmodel"]))
|
set(["id", "relatedmodel", "m2mrelatedmodel"]))
|
||||||
|
|
Loading…
Reference in New Issue