def get(self): posts = dbModels.Post.get_all_posts().order('-date') links = [] contents = [] results = "" for post in posts[0 : 3]: request = commonUtils.Request(post.title) # tweets = commonUtils.search ( post.title ) links += request.get_links() contents += request.get_content() results = commonUtils.render_template('google_results.html', links = links, contents = contents ) self.render_response('mainpage.html', posts = posts, results = results )
def render(self): return commonUtils.render_template('post.html', post = self )
def render_response( self, template, **kwargs): """ Renders the template 'template' with the values from kwargs""" rendered_page = commonUtils.render_template( template, **kwargs ) self.response.out.write( rendered_page )