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)
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())
def get(self): posts = Post.objects(author=current_user.id) return render_template('users/personal.html', posts=posts)
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)