示例#1
0
def index():
    labels = []
    data = []
    try:
        if not current_user.name == 'Anonymous':
            recent_history = model.execute(get_recent_history(), current_user.name)
            sorted_history = recent_history.items()
            sorted_history.sort() 
            for k, v in sorted_history:
                labels.append(k.strftime("%m/%d"))
                data.append([v.refbad_count, v.ref_count])    
    except Exception as e:
        flash(str(e), 'error')

    return render_template("index.html", history_labels=labels, history_data=data) 
示例#2
0
 def f(session):
     h = get_recent_history(session=session)
     for key, event in h.items():
         print key
         print event.ref_count
         print event.refbad_count