Demo entry 6682662

feedback

   

Submitted by anonymous on Dec 09, 2017 at 21:57
Language: Python. Code size: 502 Bytes.

def feedback_new(request, pk):
    if request.method == 'POST':
        print("add feedback")
        form = feedbackForm(request.POST)
        if form.is_valid():
            comment = form.save(commit=False)
            comment.post = feedbackpost.objects.get(pk=pk)
            comment.save()
            #return redirect('detail', pk=pk)
            return redirect('index')
    else:
      form = feedbackForm()

    return render(request, 'data01/feedback_form.html', {'form':form,})

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).