'Serialize id or skip if attribute with `key` is not present.'

def serialize_id_or_skip(self, content, key, **context):

    if (not hasattr(content, key)):
        raise base.SkipAttribute('no    such    attribute')
    return self.serialize_id(content, key, **context)
