def vocabulary_dict_save(vocabulary_dict, context):
    model = context['model']
    session = context['session']
    vocabulary_name = vocabulary_dict['name']
    vocabulary_obj = model.Vocabulary(vocabulary_name)
    session.add(vocabulary_obj)
    if vocabulary_dict.has_key('tags'):
        vocabulary_tag_list_save(vocabulary_dict['tags'], vocabulary_obj, context)
    return vocabulary_obj
def vocabulary_dict_save(vocabulary_dict, context):
    model = context['model']
    session = context['session']
    vocabulary_name = vocabulary_dict['name']
    vocabulary_obj = model.Vocabulary(vocabulary_name)
    session.add(vocabulary_obj)
    if vocabulary_dict.has_key('tags'):
        vocabulary_tag_list_save(vocabulary_dict['tags'], vocabulary_obj, context)
    return vocabulary_obj