예제 #1
0
 def get(self):
     for i in Form.all():
         print i.date, "deleted"
         i.delete()
     for i in Settings.all():
         print i.date, "deleted"
         i.delete()
예제 #2
0
 def get(self):
   user = users.get_current_user()
   recipient_email=cgi.escape(self.request.get('recipient_email'))
   header=cgi.escape(self.request.get('header'))
   line_start=cgi.escape(self.request.get('line_start'))
   q = db.GqlQuery("SELECT * FROM Settings WHERE user = :1", user)
   if q.get():
     user_setting=q.get()
   else:
     user_setting=Settings()
   user_setting.recipient_email=recipient_email
   user_setting.line_start=line_start
   user_setting.header=header
   user_setting.put()
   template_path = localize("setup.html")
   text=template.render(template_path, {"entered":"OK",
                                         "email":user_setting.recipient_email,
                                         "header":user_setting.header,
                                         "line_start":user_setting.line_start})
   self.response.out.write(web_publish(text))
   q = db.GqlQuery("SELECT * FROM Settings WHERE user = :1", user)