Make the database wrapper correctly handle timezone aware datetime objects

Handle conversion of timezone aware datetime fields if USE_TZ is enabled.