class JobForm(forms.ModelForm):
class Meta:
model = models.Job
That was my form, now trying to save it will raise an exception, and trying to validate it just fails with no errors....
job = get_object_or_404(models.Job, pk=1)
form = forms.JobForm(instance = job)
try:
form.save()
except:
print sys.exc_info()
#=>(<type 'exceptions.AttributeError'>, AttributeError("'JobForm' object has no attribute 'cleaned_data'",), <traceback object at 0x1029dbb48>)
Tried to validate it:
if form.is_valid():
form.save()
else:
print 'error'
print form.errors, len(form.errors)
#=> 'error'
#=> 0
So the form isn't valid, but the there are no errors! Any idea?