def index(): repos = [(key, json.loads(value)) for key, value in REDIS.hgetall('repos').items()] # repos.sort(key=lambda x:x.star) # print repos # repos.sort(key=lambda x: x['star'], reverse=True) # print repos repos.sort(key=lambda x: x[1]['star'], reverse=True) return render_template('index.html', repos=repos, keywords=REDIS.get('keywords').decode('utf-8'))
def index(): repos = [(key, json.loads(value)) for key, value in REDIS.hgetall('repos').items()] return render_template('index.html', repos=repos, keywords=REDIS.get('keywords').decode('utf-8'))
def index(): todolist = [(id.decode('utf8'), json.loads(value)) for id, value in REDIS.hgetall('todolist').items()] return render_template('index.html', todolist=todolist)