'Convert the ``values`` dictionary into the format of :meth:`write`.'

def _convert_to_write(self, values):

    fields = self._fields
    result = {}
    for (name, value) in values.iteritems():
        if (name in fields):
            field = fields[name]
            value = field.convert_to_cache(value, self, validate=False)
            value = field.convert_to_record(value, self)
            value = field.convert_to_write(value, self)
            if (not isinstance(value, NewId)):
                result[name] = value
    return result
