Exemple #1
0
def add_comment_into_list(request, storyID):
    story = mdl_story.get_story(storyID)
    if request.method == 'POST':
        form = CommentForm(request.POST)
        if form.is_valid():
            mdl_comment.create_comment(story, request.POST)
    else:
        form = CommentForm()
    comments = mdl_comment.get_comments_for_story(story)
    context = {'story': story, 'comments': comments, 'newform': form}
    return render(request, 'CommentList.html', context)
Exemple #2
0
def add_comment_into_list(request, storyID):
    story = mdl_story.get_story(storyID)
    if request.method == 'POST':
        form = CommentForm(request.POST)
        if form.is_valid():
            mdl_comment.create_comment(story,request.POST)
    else:
        form = CommentForm()
    comments = mdl_comment.get_comments_for_story(story)
    context = {
        'story': story,
        'comments': comments,
        'newform': form
    }
    return render(request, 'CommentList.html', context)