mflbackend/src/backend.py
def removecandidate(_id=''):
    """
    Remove a candidate from the candidate list
    Use with the lexcion's identifiers
        /removecandidate?identifier=katt..nn.1
    """
    lexicon = request.args.get('lexicon', C.config['default'])
    lexconf = lexconfig.get_lexiconconf(lexicon)
    try:
        identifier = request.args.get('identifier', '')
        # ask karp for the identifier
        q = 'extended||and|%s.search|equals|%s' % ('identifier', identifier)
        res = helpers.karp_query('query', query={'q': q},
                                 mode=lexconf['candidateMode'],
                                 resource=lexconf['candidatelexiconName'])
        _id = helpers.es_first_id(res)
    except Exception as e1:
        logging.error(e1)
        raise e.MflException("Could not find candidate %s" % identifier,
                             code="unknown_candidate")
    # delete it
    ans = helpers.karp_delete(_id, lexconf['candidatelexiconName'])
    return jsonify({"deleted": ans})

    Remove a candidate from the candidate list
    Use with the lexcion's identifiers
        /removecandidate?identifier=katt..nn.1
    
Remove a candidate from the candidate list
Use with the lexcion's identifiers
removecandidate?identifier=katt..nn.1
Remove a candidate from the candidate list Use with the lexcion ' s identifiers removecandidate?identifier = katt .. nn . 1
def removecandidate(_id=''):
    lexicon = request.args.get('lexicon', C.config['default'])
    lexconf = lexconfig.get_lexiconconf(lexicon)
    try:
        identifier = request.args.get('identifier', '')
        q = 'extended||and|%s.search|equals|%s' % ('identifier', identifier)
        res = helpers.karp_query('query', query={'q': q},
                                 mode=lexconf['candidateMode'],
                                 resource=lexconf['candidatelexiconName'])
        _id = helpers.es_first_id(res)
    except Exception as e1:
        logging.error(e1)
        raise e.MflException("Could not find candidate %s" % identifier,
                             code="unknown_candidate")
    ans = helpers.karp_delete(_id, lexconf['candidatelexiconName'])
    return jsonify({"deleted": ans})
def removecandidate ( _id = '' ) : lexicon = request . args . get ( 'lexicon' , C . config [ 'default' ] ) lexconf = lexconfig . get_lexiconconf ( lexicon ) try : identifier = request . args . get ( 'identifier' , '' ) q = 'extended||and|%s.search|equals|%s' % ( 'identifier' , identifier ) res = helpers . karp_query ( 'query' , query = { 'q' : q } , mode = lexconf [ 'candidateMode' ] , resource = lexconf [ 'candidatelexiconName' ] ) _id = helpers . es_first_id ( res ) except Exception as e1 : logging . error ( e1 ) raise e . MflException ( "Could not find candidate %s" % identifier , code = "unknown_candidate" ) ans = helpers . karp_delete ( _id , lexconf [ 'candidatelexiconName' ] ) return jsonify ( { "deleted" : ans } )
Remove a candidate from the candidate list
Use with the lexcion's identifiers
removecandidate?identifier=katt..nn.1
Remove a candidate from the candidate list Use with the lexcion ' s identifiers removecandidate?identifier = katt .. nn . 1
"""
    Remove a candidate from the candidate list
    Use with the lexcion's identifiers
        /removecandidate?identifier=katt..nn.1
    """ # ask karp for the identifier # delete it
_id