Tuesday, January 2, 2018

Update View not updating table when Rendering fields manually

When I am using simply this

                <form action="" method="post" enctype="multipart/form-data">                      {% block content %}                         {% csrf_token %}                         {{ form }}                         <input type="submit" value="Update" />                      {% endblock content %}                  </form>

It is updating my JobFinal Table I can see POST /JobSchd/jobform_final/3/update/ HTTP/1.1" 302 0 But when changing {{ form }} to {{ form.job_name }} It doesn't update the table and doesn't redirect to the reverse url.And I can see POST /JobSchd/jobform_final/3/update/ HTTP/1.1" 200 4492

Here is my snippet of related View.py

class JobFinalUpdate(UpdateView):      model = JobFinal      form_class = JobFormFinal      template_name_suffix = '_update_form'          def get_success_url(self):          return reverse('JobSchd:user_details',kwargs={'pk': self.request.user.id})

Here is my form.py class JobFormFinal(forms.ModelForm):

class Meta:      model=JobFinal      exclude=['user']
Thank You!
Kind Regards,
Sumit Kumar| +1-480-740-7728

Please consider the environment before printing.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOvNbK5MPctf16RfaZzcfc%3Dt4USd%2B3Ey0H0mm7hT%3DGeh_zbyug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment