def render_blog(self, blog_posts="", username="", source=""): if self.user: username = self.user.name # check if user is logged in and get name source = self.request.url # Posted to the Like handler so it can redirect back blog_posts = Blog_post.all().ancestor( blog_key()).order('-created').run() self.render("home.html", blog_posts=blog_posts, username=username, source=source)
def render_posts(self, blog_posts="", username=""): username = self.user.name blog_posts = Blog_post.all().filter("owner =", username).order('-created').run() self.render("my_posts.html", blog_posts=blog_posts, username=username)