Esempio n. 1
0
 def get(self):
     article_qs = Article.all()
     nickname = self.request.get('user')
     if nickname:
         p= ProfileByNickView(nickname).get()
         if p:
             article_qs.filter('creator =', p.get_user())
     article_qs.order('-date_modified')
     articles = each_profiles(article_qs, field='creator')
     return self.render('article_list.html', locals())
Esempio n. 2
0
 def get(self, user_name=None):
     login_user = self.get_current_user()
     target_profile = ProfileByNickView(user_name).get()
     if target_profile is None:
         return self.error(404)
     target_user = target_profile.get_user()
     follow = Follow.new(login_user, target_user)
     if follow is None:
         return self.error(404)
     follow.update_profile()
     return self.redirect('/home')
Esempio n. 3
0
 def get(self, user_name=None):
     login_user = self.get_current_user()
     target_profile = ProfileByNickView(user_name).get()
     if target_profile is None:
         return self.error(404)
     target_user = target_profile.get_user()
     follow = Follow.gql("WHERE from_user=:1 AND to_user=:2", login_user, target_user).get()
     if follow:
         follow.delete()
         follow.update_profile()
     BlipLink.delete_for_author(login_user, target_user)
     return self.redirect('/home')