'Update the relation to be ``value``.'

def save_relation_data(self, instance, name, value):

    instance_field = getattr(instance, name)
    for related in instance_field.all():
        if (related.object not in value):
            instance_field.remove(related)
    for related in value:
        instance_field.connect(related)
