コード例 #1
0
def turn_fresult ():
    tag = list(request.form['tag'].split(';'))
    rnct = of.format_ranked_nct(request.form['nct'])
    npag = int (request.form['npag'])
    log.info ('%s -- visiting page n. %d' % (request.remote_addr, npag))
    (snct, unct) = tcloud.get_filtered_result (tag, rnct, npag)
    return jsonify (n=of.format_nct_number(len(unct)), npag=npag, onct=request.form['nct'], nct=of.format_nct(snct))
コード例 #2
0
def refine_tagcloud():
    tgrp = request.form['ttag']
    tag = list(request.form['tag'].split(';'))
    rnct = of.format_ranked_nct (request.form['nct'])
    nct = tcloud.filter_by_tag (tag, rnct)
    trole = request.form['trole']
    ctag = []
    if len(nct) > 1:
        ctag = tcloud.get_tagcloud (nct, tag, 20, 10, tgrp, trole)
    return jsonify (tags=ctag, nct=request.form['nct'], tgrp=tgrp, trole=trole)
コード例 #3
0
def refine_search ():
    tag = list(request.form['tag'].split(';'))
    rnct = of.format_ranked_nct (request.form['nct'])
    npag = int (request.form['npag'])
    tgrp = request.form['ttag']
    trole = request.form['trole']
    (snct, unct) = tcloud.get_filtered_result (tag, rnct, npag)
    log.info ('%s -- refine-search: tags(%s) | left(%d trials)' % (request.remote_addr, ';'.join(tag), len(unct)))
    ctag = []
    if len(unct) > 0:
        ctag = tcloud.get_tagcloud (unct, tag, 20, 10, tgrp, trole)
    return jsonify (n=of.format_nct_number(len(unct)), npag=npag, tags=ctag, q=session['query'], onct=request.form['nct'], nct=of.format_nct(snct))