expires = row[2]ifconnections[db].features.needs_datetime_string_castandnotisinstance(expires, datetime):# Note: typecasting is needed by some 3rd party database backends.# All core backends work without typecasting, so be careful about# changes here - test suite will NOT pick regressions here...
datetime = self.resolve_columns(row, fields)[offset]elifneeds_string_cast: datetime =typecast_timestamp(str(datetime))# Datetimes are artifically returned in UTC on databases that# don't support time zone. Restore the zone used in the query.ifsettings.USE_TZ:ifdatetimeisNone:raiseValueError("...