Exemplo n.º 1
0
    def get(self):
        checkLoggedInAndRegistered(self)

        all_posts = Posts.query().fetch()

        the_variable_dict = {"all_posts": all_posts}

        all_posts_template = the_jinja_env.get_template(
            'templates/all_posts.html')
        self.response.write(all_posts_template.render(the_variable_dict))
Exemplo n.º 2
0
    def get(self):
        checkLoggedInAndRegistered(self)

        profile_posts = Posts.query()

        the_variable_dict = {
            "logout_url": users.create_logout_url('/'),
            "profile_posts": profile_posts
        }

        welcome_template = the_jinja_env.get_template(
            'templates/homepage.html')
        self.response.write(welcome_template.render(the_variable_dict))
Exemplo n.º 3
0
    def get(self):
        checkLoggedInAndRegistered(self)

        profile = users.get_current_user()
        email_address = profile.nickname()

        profile_posts = Posts.query().filter(
            Posts.owner == email_address).fetch()
        print("***********************************************")
        print(profile_posts)
        the_variable_dict = {
            "logout_url": users.create_logout_url('/'),
            "profile_posts": profile_posts,
        }

        profile_posts_template = the_jinja_env.get_template(
            'templates/profile_posts.html')
        self.response.write(profile_posts_template.render(the_variable_dict))
Exemplo n.º 4
0
	def getTheRequiredPosts(self):
		return Posts.query().order(-Posts.timeOfCreation);
Exemplo n.º 5
0
 def test_refresh_db(self):
     Posts.refresh_db(facebook_api_data.resp1["data"])
     self.assertEqual(Posts.query().count(), 10)
     Posts.refresh_db(facebook_api_data.resp2["data"])
     self.assertEqual(Posts.query().count(), 1)
Exemplo n.º 6
0
 def get(self):
     client = users.get_current_user()
     profile_post = Posts.query().fetch()
     print("&&&&&&&&&&&&&&&&")
     print(profile_post[0])