def detail_distro(req, dbname, fid): db = DoitDB(dbname) attr_name = db.fieldname(fid) vals = db.fieldexamples(fid, 1000, distinct=False) histos = [bucketize(vals)] histos[0]['name'] = attr_name matches = db.field_candidates(fid)[:4] for match in matches: histo = bucketize(db.globalfieldexamples(int(match['id']), n=1000, distinct=False)) histo['name'] = match['name'] histos.append(histo) return render_to_response('doit/pop_distro.html', { 'histos': histos, 'attr_name': attr_name, 'fid': fid, 'db': dbname,})
def detail_distro(req, dbname, fid): db = DoitDB(dbname) attr_name = db.fieldname(fid) vals = db.fieldexamples(fid, 1000, distinct=False) histos = [bucketize(vals)] histos[0]['name'] = attr_name matches = db.field_candidates(fid)[:4] for match in matches: histo = bucketize(db.globalfieldexamples(int(match['id']), n=1000, distinct=False)) histo['name'] = match['name'] histos.append(histo) return render(req, 'doit/pop_distro.html', { 'histos': histos, 'attr_name': attr_name, 'fid': fid, 'db': dbname, })
def detail_summary(req, sid, dbname, fid): db = DoitDB(dbname) attr_name = db.fieldname(fid) meta = db.field_meta(fid) vals = db.fieldexamples(fid, 1000, distinct=False) histo = bucketize(vals) return render_to_response('doit/pop_summary.html', {'histo': histo, 'attr_name': attr_name, 'source': sid, 'fid': fid, 'metadata': meta,})
def detail_distro(req, dbname, sid, fid): db = DoitDB(dbname) attr_name = db.fieldname(fid) vals = db.fieldexamples(fid, 1000, distinct=False) histos = [bucketize(vals)] histos[0]['name'] = attr_name matches = sorted(db.field_mappings(sid)[int(fid)]['matches'], key=itemgetter('score'), reverse=True)[:4] for match in matches: histo = bucketize(db.globalfieldexamples(int(match['id']), n=1000, distinct=False)) histo['name'] = match['name'] histos.append(histo) return render_to_response('doit/pop_distro.html', {'histos': histos, 'attr_name': attr_name, 'fid': fid,})
def detail_summary(req, dbname, fid): db = DoitDB(dbname) attr_name = db.fieldname(fid) meta = db.field_meta(fid) vals = db.fieldexamples(fid, 1000, distinct=False) histo = bucketize(vals) return render_to_response('doit/pop_summary.html', { 'histo': histo, 'attr_name': attr_name, 'source': '', 'fid': fid, 'metadata': meta, 'db': dbname,})