Esempio n. 1
0
def dedup_source(req, dbname, sid):
    db = TamerDB(dbname)
    # db.dedup_source(sid)
    c = {
        'source_name': db.sourcename(sid),
        'dbname': dbname,
        'source_id': sid,
        'limits': [.1 * x for x in range(11)[5:]],
        'navitems': nav_items(db), }
    return render(req, 'tamer/dedup-console.html', c)
Esempio n. 2
0
def schema_map_source(req, dbname, sid):
    db = TamerDB(dbname)
    redirect_url = '%s/import/schema-map/questions' % settings.EXPERTSRC_URL
    thresh_incr_num = map(lambda x: (x + 1) / 10.0, reversed(range(20)))
    greens = map(lambda x: f2c(x / 1.0), thresh_incr_num)
    reds = map(lambda x: f2c(1.0 - x / 2.0), thresh_incr_num)
    thresh_incr = []
    for x in range(len(thresh_incr_num)):
        point = {}
        point['val'] = thresh_incr_num[x]
        point['green'] = greens[x]
        point['red'] = reds[x]
        thresh_incr.append(point)
    c = {'redirect_url': redirect_url,
        'source_id': db.sourcename(sid),
        'dbname': dbname,
        'sid': sid,
        'navitems': nav_items(db),
        'source_name': 'test_source',
        'threshhold_increments': thresh_incr, }
    return render(req, 'tamer/schema-map-console.html', c)