

def results_iter(self):
    '\n        Returns an iterator over the results from executing this query.\n        '
    resolve_columns = hasattr(self, 'resolve_columns')
    if resolve_columns:
        from django.db.models.fields import DateTimeField
        fields = [DateTimeField()]
    else:
        from django.db.backends.util import typecast_timestamp
        needs_string_cast = self.connection.features.needs_datetime_string_cast
    offset = len(self.query.extra_select)
    for rows in self.execute_sql(MULTI):
        for row in rows:
            datetime = row[offset]
            if resolve_columns:
                datetime = self.resolve_columns(offset, fields)[offset]
            elif needs_string_cast:
                datetime = typecast_timestamp(str(datetime))
            if settings.USE_TZ:
                if (datetime is None):
                    raise ValueError('Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?')
                datetime = datetime.replace(tzinfo=None)
                datetime = timezone.make_aware(datetime, self.query.tzinfo)
            (yield datetime)

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/compiler.py SQLDateTimeCompiler.results_iter/VarMisuse@120/180 `row`->`offset`