get_klass_info should handle proxy models and with select_related
If I do not apply attached patch to django/db/models/query.py, the following test case fails:
======================================================================
ERROR: test_defer (modeltests.defer.tests.DeferTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\django_versions\Django-1.4c1\tests\modeltests\defer\tests.py", line 149, in test_defer
for obj in ChildProxy.objects.all().select_related().only('id'):
File "C:\Python26\lib\site-packages\django_versions\Django-1.4c1\django\db\models\query.py", line 118, in _result_iter
self._fill_cache()
File "C:\Python26\lib\site-packages\django_versions\Django-1.4c1\django\db\models\query.py", line 875, in _fill_cache
self._result_cache.append(self._iter.next())
File "C:\Python26\lib\site-packages\django_versions\Django-1.4c1\django\db\models\query.py", line 290, in iterator
requested=requested, only_load=only_load)
File "C:\Python26\lib\site-packages\django_versions\Django-1.4c1\django\db\models\query.py", line 1276, in get_klass_info
load_fields.update(fields)
AttributeError: 'NoneType' object has no attribute 'update'
----------------------------------------------------------------------
Ran 170 tests in 0.700s
FAILED (errors=1)
patch and test case