def new_questions(request, red): args = request.args cookie = request.cookies page = 0 sessionInfo = {} if not args.has_key('page'): page = 1 else: page = args['page'] import loadHome ques, hot_articles = loadHome.load_home(int(page), 1) if cookie.has_key('session_id'): sessionInfo = getSessionInfo( red, cookie['session_id'], ['nickname', 'head_url', 'reputation', 'authority']) return render_template('home.html', questions=ques, type='questions', user=sessionInfo, url='/questions/newest', hot_articles=hot_articles)
def hello_world(): cookie = request.cookies sessionInfo = {} info = '' page = 1 req = request.args if req.has_key('page'): page = req['page'] import loadHome ques, hot_articles = loadHome.load_home(int(page), 1) if cookie.has_key('session_id'): sessionInfo = getSessionInfo(red, cookie['session_id'], ['nickname', 'head_url', 'reputation', 'authority']) return render_template('home.html', questions=ques, type='questions', user=sessionInfo, url='/', hot_articles=hot_articles)
def testLoadQuestion(self): ret_data, hot_articles = loadHome.load_home(self.page, self.mtype) print ret_data print hot_articles