def community_index(request): search = request.GET.get('search') all_posts = Api.get_all(Api, posts_url, user_id=None, search=search, post_id=None) return render(request, 'community_index.html', {'posts': all_posts, 'search': search})
def post_details(request, id): post = PostsApi.post_by_id(PostsApi, id) replies = Api.get_all(Api, reply_url, user_id=None, search=None, post_id=id) return render(request, 'post_details.html', {'post': post, 'replies': replies})