def vocabulary_tag_list_save(new_tag_dicts, vocabulary_obj, context):
    model = context['model']
    session = context['session']
    for tag in vocabulary_obj.tags:
        if (tag.name not in [t['name'] for t in new_tag_dicts]):
            tag.delete()
    for tag_dict in new_tag_dicts:
        current_tag_names = [tag.name for tag in vocabulary_obj.tags]
        if (tag_dict['name'] not in current_tag_names):
            tag_dict['vocabulary_id'] = vocabulary_obj.id
            tag_dict_save(tag_dict, {'model': model, 'session': session})
def vocabulary_tag_list_save(new_tag_dicts, vocabulary_obj, context):
    model = context['model']
    session = context['session']
    for tag in vocabulary_obj.tags:
        if (tag.name not in [t['name'] for t in new_tag_dicts]):
            tag.delete()
    for tag_dict in new_tag_dicts:
        current_tag_names = [tag.name for tag in vocabulary_obj.tags]
        if (tag_dict['name'] not in current_tag_names):
            tag_dict['vocabulary_id'] = vocabulary_obj.id
            tag_dict_save(tag_dict, {'model': model, 'session': session})