Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 2706fdbc87037976c3165beb5b9b73e000ff479b 1 parent 04654e5
Carl Meyer authored April 27, 2011
2  django/db/models/options.py
@@ -420,7 +420,7 @@ def _fill_related_many_to_many_cache(self):
420 420
                     cache[obj] = parent
421 421
                 else:
422 422
                     cache[obj] = model
423  
-        for klass in get_models():
  423
+        for klass in get_models(only_installed=False):
424 424
             for f in klass._meta.local_many_to_many:
425 425
                 if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
426 426
                     cache[RelatedObject(f.rel.to, klass, f)] = None
4  tests/regressiontests/app_loading/not_installed/models.py
@@ -7,3 +7,7 @@ class NotInstalledModel(models.Model):
7 7
 
8 8
 class RelatedModel(models.Model):
9 9
     not_installed = models.ForeignKey(NotInstalledModel)
  10
+
  11
+
  12
+class M2MRelatedModel(models.Model):
  13
+    not_installed = models.ManyToManyField(NotInstalledModel)
2  tests/regressiontests/app_loading/tests.py
@@ -122,4 +122,4 @@ def test_related_not_installed_model(self):
122 122
         from .not_installed.models import NotInstalledModel
123 123
         self.assertEqual(
124 124
             set(NotInstalledModel._meta.get_all_field_names()),
125  
-            set(["id", "relatedmodel"]))
  125
+            set(["id", "relatedmodel", "m2mrelatedmodel"]))

0 notes on commit 2706fdb

Please sign in to comment.
Something went wrong with that request. Please try again.