How to save multiple partial views on a submit?

Why am I not able to save the form data in Django?

  • I am not able to save the form data http://views.py     @login_required     def crave_view(request, id):                 crave = get_object_or_404(CraveData, pk=id)                 check = Comment.objects.filter(crave=http://crave.id)         print check         if request.method=="POST":             form=CraveReplyForm(request.POST, request.FILES)             if form.is_valid():                 reply = form.save(commit=False)                 reply.person=request.user                 reply.person=request.cravedata                 reply.crave = crave                 reply.save()                            else:                                form=CraveReplyForm()                 return render(request, "crave/Comment.html", {'crave': crave, 'form' : form, 'check':check}) http://url.py     url(r'^reply_get/(?P<id>.*)$', 'crave_view'), comment.html     <form class="horizontal-form" role="form" action="/comment/reply_get/{{http://crave.id}}" method="post"  style="padding: 10px;">        {% csrf_token %}     <div class="form-group" >     <div class="col-sm-10">     {{ form.reply.label_tag }} {{ form.reply }} </br> </br>     </div>         </div>     <input type="submit" class="btn btn-success" value="reply" />     </form> http://forms.py     class CraveDataForm(forms.ModelForm):         class Meta:             model = CraveData             exclude=['date', 'password1', 'password2', 'username', 'person'] I am getting id in url but reply is not getting saved to backend. Getting the error as " return int(value)" I dont know what wrong i am doing, please help me out. I want to save the reply to backend.

  • Answer:

    They have a website for these queries , and its called "stackoverflow".

Anonymous at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.