def get(self): template_params = {} user = None if self.request.cookies.get('our_token'): #the cookie that should contain the access token! user = User.check_token(self.request.cookies.get('our_token')) template_params = {} if user: template_params['user'] = user.username if not user: self.redirect('/home') template_params['histories'] =[] histories = History.getHistory() for h in histories: template_params['histories'].append({ "date": h.date, "symbol": h.symbol, "enterprice": h.enterprice, "stoplose": h.stoplose, "takeprofit": h.takeprofit, "profitorloss":h.profitorloss, "volume": h.volume, "lstype": h.lstype, "remarks": h.remarks }) html = template.render("web/templates/history.html", template_params) self.response.write(html)
def get(self): template_params = {} user = None if self.request.cookies.get('our_token'): #the cookie that should contain the access token! user = User.check_token(self.request.cookies.get('our_token')) template_params = {} if user: template_params['user'] = user.username if not user: self.redirect('/home') template_params['alerts'] =[] alerts = Alert.getalerts() for a in alerts: template_params['alerts'].append({ "date": a.date, "symbol": a.symbol, "enterprice": a.enterprice, "stoplose": a.stoplose, "takeprofit": a.takeprofit, "volume": a.volume, "lstype": a.lstype }) html = template.render("web/templates/alert.html", template_params) self.response.write(html)
def get(self): user = None if self.request.cookies.get('our_token'): #the cookie that should contain the access token! user = User.check_token(self.request.cookies.get('our_token')) template_params = {} if user: template_params['user'] = user.username html = template.render('web/templates/home.html', template_params) self.response.write(html)
def get(self): template_params = {} user = None if self.request.cookies.get('our_token'): #the cookie that should contain the access token! user = User.check_token(self.request.cookies.get('our_token')) template_params = {} if user: template_params['user'] = user.username if not user: self.redirect('/home') html = template.render("web/templates/risk.html", template_params) self.response.write(html)