Beispiel #1
0
def comment_add(request):

    if request.method == 'POST':
        article_id = request.POST.get('article', '')
        detail = request.POST.get('detail', '')
        if article_id and detail:
            comment = Comment()
            comment.Article = Article(id=article_id)
            comment.detail = detail
            comment.save()

    return HttpResponseRedirect('/view/%s' % article_id)