src/ckanext-Metadata/ckanext/Metadata/plugin.py
def __create_vocabulary(cls, name, *values):
        '''Create vocab and tags, if they don't exist already.
            name: the name or unique id of the vocabulary  e.g. 'flower_colors'
            values: the values that the vocabulary can take on e.g. ('blue', 'orange', 'purple', 'white', 'yellow)
        '''
        user = p.toolkit.get_action('get_site_user')({'ignore_auth': True}, {})
        context = {'user': user['name']}

        log.debug("Creating vocab '{0}'".format(name))
        data = {'name': name}
        vocab = p.toolkit.get_action('vocabulary_create')(context, data)
        log.debug('Vocab created: {0}'.format(vocab))
        for tag in values:
            log.debug(
                "Adding tag {0} to vocab {1}'".format(tag, name))
            data = {'name': tag, 'vocabulary_id': vocab['id']}
            p.toolkit.get_action('tag_create')(context, data)
        return vocab
Create vocab and tags, if they don't exist already.
            name: the name or unique id of the vocabulary  e.g. 'flower_colors'
            values: the values that the vocabulary can take on e.g. ('blue', 'orange', 'purple', 'white', 'yellow)
        
Create vocab and tags, if they don't exist already.
name: the name or unique id of the vocabulary  e.g. 'flower_colors'
values: the values that the vocabulary can take on e.g.
Create vocab and tags if they don ' t exist already . name : the name or unique id of the vocabulary e . g . ' flower_colors ' values : the values that the vocabulary can take on e . g .
def __create_vocabulary(cls, name, *values):
        user = p.toolkit.get_action('get_site_user')({'ignore_auth': True}, {})
        context = {'user': user['name']}
        log.debug("Creating vocab '{0}'".format(name))
        data = {'name': name}
        vocab = p.toolkit.get_action('vocabulary_create')(context, data)
        log.debug('Vocab created: {0}'.format(vocab))
        for tag in values:
            log.debug(
                "Adding tag {0} to vocab {1}'".format(tag, name))
            data = {'name': tag, 'vocabulary_id': vocab['id']}
            p.toolkit.get_action('tag_create')(context, data)
        return vocab
def __create_vocabulary ( cls , name , * values ) : user = p . toolkit . get_action ( 'get_site_user' ) ( { 'ignore_auth' : True } , { } ) context = { 'user' : user [ 'name' ] } log . debug ( "Creating vocab '{0}'" . format ( name ) ) data = { 'name' : name } vocab = p . toolkit . get_action ( 'vocabulary_create' ) ( context , data ) log . debug ( 'Vocab created: {0}' . format ( vocab ) ) for tag in values : log . debug ( "Adding tag {0} to vocab {1}'" . format ( tag , name ) ) data = { 'name' : tag , 'vocabulary_id' : vocab [ 'id' ] } p . toolkit . get_action ( 'tag_create' ) ( context , data ) return vocab
Create vocab and tags, if they don't exist already.
Create vocab and tags if they don ' t exist already .
'''Create vocab and tags, if they don't exist already.
            name: the name or unique id of the vocabulary  e.g. 'flower_colors'
            values: the values that the vocabulary can take on e.g. ('blue', 'orange', 'purple', 'white', 'yellow)
        '''
cls
name