From 2706fdbc87037976c3165beb5b9b73e000ff479b Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Wed, 27 Apr 2011 17:51:43 +0000 Subject: [PATCH] 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 --- django/db/models/options.py | 2 +- tests/regressiontests/app_loading/not_installed/models.py | 4 ++++ tests/regressiontests/app_loading/tests.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/django/db/models/options.py b/django/db/models/options.py index 15cb18b1336..6f0f406aaa2 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -420,7 +420,7 @@ class Options(object): cache[obj] = parent else: 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: if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta: cache[RelatedObject(f.rel.to, klass, f)] = None diff --git a/tests/regressiontests/app_loading/not_installed/models.py b/tests/regressiontests/app_loading/not_installed/models.py index f62235dfd5c..1e4b59894c4 100644 --- a/tests/regressiontests/app_loading/not_installed/models.py +++ b/tests/regressiontests/app_loading/not_installed/models.py @@ -7,3 +7,7 @@ class NotInstalledModel(models.Model): class RelatedModel(models.Model): not_installed = models.ForeignKey(NotInstalledModel) + + +class M2MRelatedModel(models.Model): + not_installed = models.ManyToManyField(NotInstalledModel) diff --git a/tests/regressiontests/app_loading/tests.py b/tests/regressiontests/app_loading/tests.py index 3036ab8c07b..749f24aeb1d 100644 --- a/tests/regressiontests/app_loading/tests.py +++ b/tests/regressiontests/app_loading/tests.py @@ -122,4 +122,4 @@ class NotInstalledModelsTest(TestCase): from .not_installed.models import NotInstalledModel self.assertEqual( set(NotInstalledModel._meta.get_all_field_names()), - set(["id", "relatedmodel"])) + set(["id", "relatedmodel", "m2mrelatedmodel"]))