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']
Please consider the environment before printing.
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!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...@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.