Fixed #15903 -- Allowed not-installed models to still be referenced in related fields. Missed case from r16053.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer 2011-04-27 15:46:43 +00:00
parent 2f9c52dc90
commit c85b765288
4 changed files with 36 additions and 7 deletions

View file

@ -383,7 +383,7 @@ class Options(object):
cache[obj] = parent
else:
cache[obj] = model
for klass in get_models(include_auto_created=True):
for klass in get_models(include_auto_created=True, only_installed=False):
for f in klass._meta.local_fields:
if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
cache[RelatedObject(f.rel.to, klass, f)] = None