Exemplo n.º 1
0
def comment_view(environ):
    context = Comment().errors
    if environ['REQUEST_METHOD'] == 'POST':
        comment = Comment()
        comment.import_post_form(environ)
        if comment.is_valid():
            comment.save()
            return render('success.html')
        else:
            context = comment.errors
    return render('form.html', context)