2013-03-02 26 views

回答

1
def post(self): 
    q = db.Query(db_Person) 

    message = "Innsetning tokst" 

    in_kennitala = int(self.request.get('p_kennitala')) 
    in_nafn = self.request.get('p_nafn') 
    in_heimili = self.request.get('p_heimili') 
    in_postnumer = self.request.get('p_postnumer') 
    in_stadur = self.request.get('p_stadur') 
    in_land = self.request.get('p_land') 
    in_simi = int(self.request.get('p_simi')) 
    in_gsm = int(self.request.get('p_gsm') # <- missing right parenthesis 

    B = db_Person(nafn='Alex')    # <- parser gets confused here 
    B.put() 

    template_values = { 
      'message': message 
    } 

    template = jinja_environment.get_template('breyta.html') 
    self.response.out.write(template.render(template_values)) 

 

這是固定的代碼:

def post(self): 
    q = db.Query(db_Person) 

    message = "Innsetning tokst" 

    in_kennitala = int(self.request.get('p_kennitala')) 
    in_nafn = self.request.get('p_nafn') 
    in_heimili = self.request.get('p_heimili') 
    in_postnumer = self.request.get('p_postnumer') 
    in_stadur = self.request.get('p_stadur') 
    in_land = self.request.get('p_land') 
    in_simi = int(self.request.get('p_simi')) 
    in_gsm = int(self.request.get('p_gsm')) 

    B = db_Person(nafn='Alex') 
    B.put() 

    template_values = { 
      'message': message 
    } 

    template = jinja_environment.get_template('breyta.html') 
    self.response.out.write(template.render(template_values)) 
+0

那不能做我曾做過的那個 – user2127102 2013-03-02 17:12:51

+0

感嘆。編輯更清晰。 – 2013-03-02 17:14:32

+0

對不起,感謝我很新的python – user2127102 2013-03-02 17:20:12

相關問題