コード例 #1
0
def vote(code):
    json_editor('json_data_file', code)
    programme_list = json_reader('json_data_file')
    return render_template('index.html', programme_list=programme_list)
コード例 #2
0
def leaders():
    programme_list = json_reader('json_data_file')
    newlist = sorted(programme_list, key=itemgetter('stars'), reverse=True)
    return render_template('leaders.html', programme_list=newlist)
コード例 #3
0
def index():
    try:
        programme_list = json_reader('json_data_file')
        return render_template('index.html', programme_list=programme_list)
    except FileNotFoundError:
        return render_template('index.html', message="Please upload a file.")