Prefetch related does not work for fkey to multitable inherited model
Using Django 1.4 with some latest prefetch related patches from trunk, the prefetch_related does not work for fkeys to models that are inherited from some other model.
Without the applied patch, the attached test case fails with:
======================================================================
ERROR: test_foreignkey (modeltests.prefetch_related.tests.MultiTableInheritanceT
est)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\django_versions\trunk\tests\modeltests\pre
fetch_related\tests.py", line 344, in test_foreignkey
reviews = [obj.book.title for obj in qs]
File "C:\Python26\lib\site-packages\django_versions\trunk\django\db\models\fie
lds\related.py", line 379, in __get__
raise self.field.rel.to.DoesNotExist
DoesNotExist
Change History
(6)
Triage Stage: |
Unreviewed → Accepted
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
shorter and still working patch, which does not lead to deadlock while resolving pkey