'Returns a function that will be used to instantiate query results'

def _get_result_constructor(self):

    if (not self._values_list):
        return self.model._construct_instance
    elif self._flat_values_list:
        key = self._only_fields[0]
        return (lambda row: row[key])
    else:
        return (lambda row: [row[f] for f in self._only_fields])
