Ejemplo n.º 1
0
 def get(self, tag):
   posts = Post.objects(tags=tag)
   tags = Post.objects.distinct("tags")
   all_tags = []
   for tag in tags:
     all_tags.append({
       'tag': tag,
       'count': Post.objects(tags=tag).count()
       })
   print all_tags
   return render_template('posts/list.html', posts = posts, tags = all_tags)
Ejemplo n.º 2
0
 def get(self):
   user = User.objects.get(id=current_user.id)
   form = ProfileForm(obj=user)
   posts = Post.objects(author=current_user.id)
   return render_template('users/profile.html', 
       form=form,
       posts = posts,
       user = user,
       twitter_conn=social.twitter.get_connection(),
       facebook_conn=social.facebook.get_connection())
Ejemplo n.º 3
0
 def get(self):
   posts = Post.objects(author=current_user.id)
   return render_template('users/personal.html', posts=posts)
Ejemplo n.º 4
0
 def get(self, username):
   user = User.objects.get_or_404(username=username)
   posts = Post.objects(author=user.id)
   return render_template('users/user.html', user=user, posts=posts)