'Delete or undelete `item` based on `val` then return `item.deleted`.'

def deserialize_deleted(self, item, key, val, **context):

    new_deleted = self.validate.bool(key, val)
    if (new_deleted == item.deleted):
        return item.deleted
    if new_deleted:
        self.manager.delete(item, flush=False)
    else:
        self.manager.undelete(item, flush=False)
    return item.deleted
