django/django — pull request #1678 by akaariai (2013-09-24 19:43:33+00:00)
Title: Fixed #21126 -- QuerySet value conversion failure

A .annotate().select_related() query resulted in misaligned rows vs
columns for compiler.resolve_columns() method.

Report & patch by Michael Manfre.

For master and 1.6 this seems safe enough to do.

For 1.5.x the question is will some backends (either core or 3rd party) fail for None fields in convert_values(). Here the other choices seem to be (for 1.5.x only):
- No backpatch
- Create a fake field (either plain Field() or something similar to what gis uses in django.contrib.gis.db.models.sql.conversion.py:BaseField)

I talked about this with manfre on IRC and we agreed that None is safe enough. But I have a bad feeling about this as "upgrade django, site doesn't work" situation is possible.