def renderJson(self, user): results = BodyCompost.all().filter('username = '******'measure_datetime') return results
def renderList(self): body_composts = BodyCompost.all().filter('username ='******'-measure_datetime') self.template_values['body_composts'] = body_composts return self.template_values
def post(self): from datetime import datetime self.user = users.get_current_user() measure_datetime = cgi.escape(self.request.get('measure_datetime'),True) weight = cgi.escape(self.request.get('weight'),True) bmi = cgi.escape(self.request.get('bmi'),True) bodyfat_percentage = cgi.escape(self.request.get('bodyfat_percentage'),True) skeltal_mascle_percentage = cgi.escape(self.request.get('skeltal_mascle_percentage'),True) basal_metabolism = cgi.escape(self.request.get('basal_metabolism'),True) bodyfat_lv = cgi.escape(self.request.get('bodyfat_lv'),True) body_age = cgi.escape(self.request.get('body_age'),True) body_compost = BodyCompost() body_compost.username = str(self.user.nickname()) body_compost.measure_datetime = datetime.strptime(measure_datetime, "%Y-%m-%dT%H:%MZ") body_compost.weight = float(weight) body_compost.bmi = float(bmi) body_compost.bodyfat_percentage = float(bodyfat_percentage) body_compost.skeltal_mascle_percentage = float(skeltal_mascle_percentage) body_compost.basal_metabolism = int(basal_metabolism,10) body_compost.bodyfat_lv = int(bodyfat_lv,10) body_compost.body_age = int(body_age,10) body_compost.put() self.redirect('/listBodyCompost')
def renderJson(self,user): results = BodyCompost.all().filter('username = '******'measure_datetime') return results