def get(self): user = users.get_current_user() if user: # self.response.headers['Content-Type'] = 'text/plain' template_path = localize("main_page_template.html") titles = [i.title for i in Form.all()] titles.sort() forms_titles = {"forms_titles": titles} text = template.render(template_path, forms_titles) self.response.out.write(web_publish(text)) # self.response.out.write('Hello, ' + user.nickname()) else: self.redirect(users.create_login_url(self.request.uri))
def get(self): template_path = localize("setup.html") user = users.get_current_user() q = db.GqlQuery("SELECT * FROM Settings WHERE user = :1", user) #print q #userprefs = q.get() # q=Settings.all().filter("user="******"entered":"", "email":user_setting.recipient_email, "header":user_setting.header, "line_start":user_setting.line_start}) else: text=template.render(template_path, {"entered":"","email":"", "header":"","line_start":""}) self.response.out.write(web_publish(text))
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)
def __init__(self): template_path = localize("form_edit_template.html") self.form = template.render(template_path, {})
def __init__(self): WebPages.__init__(self) self.template_path = localize("forms_results_template.html")