Facing probem in update function.The XXX could not be changed because the data didn't validate.

Model.py
class Employee(models.Model):
empID = models.CharField(max_length=5)
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
gender = models.CharField(max_length=2)
dob = models.DateField()
pan_num = models.CharField(max_length=15)
adhar_num = models.CharField(max_length=15)
mobile = models.CharField(max_length=15)
emailID = models.EmailField()
office_mail = models.CharField(max_length=150)
permanent_address = models.TextField()
present_address = models.TextField()
blood_group = models.CharField(max_length=5)
doj = models.DateField()
emp_level = models.CharField(max_length=13)
post_name = models.CharField(max_length=30)
basic_pay = models.DecimalField(max_digits=30, decimal_places=4)
house_allowance = models.DecimalField(max_digits=20, decimal_places=4)

Edit.html

{% csrf_token %}
Update

views.py

def update(request, id):
employee = Employee.objects.get(id=id)
form = EmployeeForm(request.POST, instance=employee)
form.save()
return redirect(’/show’)

I am a newbie in Django I am trying to update the form but I am unable to do it. Its always showing
ValueError at /update/10
The Employee could not be changed because the data didn’t validate.
please help

You’ll want expand your view to handle the case where a form isn’t valid and returns error messages so you can see what’s going wrong.

I suggest you review the entire page for Working with forms, particularly the sections for the view and rendering error messages.