def thisfriend(friendchoose): cur_user = User(friendchoose) friend = cur_user.show_info() record = Record(friendchoose) diaries = record.display() print(diaries) ''' diaries = [ { '' 'time': '2019-05-23, 7:30pm', 'content': '你好,我也是小爱同学' } ] ''' # friend = {'ID':friendchoose,'name':'balabala','others':'anything'} return render_template('thisfriend.html', friend=friend, diaries=diaries, user_info_global=user_info_global)
def index(): record = Record(current_user.user_email) list = record.display() print(list) request = Relation_control() messages = request.show_deal_request(current_user.user_email) count = len(messages) myfriend = Friend_control() cur_friend = myfriend.friend_count(current_user.user_email) fcount = len(cur_friend) wcnt = ord(current_user.user_email[-1]) % 3 user_info_global["name"] = current_user.user_email user_info_global["f_count"] = fcount user_info_global["wcnt"] = wcnt user_info_global["mcnt"] = count print(wcnt) print(ord("a") % 3) print(ord("m") % 3) return render_template('index.html', name=current_user.user_email, diaries=list, messagenum=count, myID=current_user.user_email, user_info_global=user_info_global)