Created
September 19, 2013 16:03
Revisions
-
manfre created this gist
Sep 19, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): # If the results are sliced, the resultset will have an initial # "row number" column. Remove this column before the ORM sees it. if getattr(self, '_using_row_number', False): row = row[1:] values = [] index_extra_select = len(self.query.extra_select.keys()) for value, field in map(None, row[index_extra_select:], fields): if field: try: val = self.connection.ops.convert_values(value, field) except ValueError: val = value values.append(val) return row[:index_extra_select] + tuple(values)