Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
 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)