Opened 15 years ago
Closed 13 years ago
#15591 closed Bug (fixed)
ModelForm save() behavior contradicts with Model object validation documentation.
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Documentation | Version: | 1.2 |
| Severity: | Normal | Keywords: | modelform validation save model object |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The documentation at http://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objectsstates that:
"Note that full_clean() will not be called automatically when you call your model’s save() method, nor as a result of ModelForm validation."
However, this is contradicted by the documentation at http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ that states that:
"Note that save() will raise a ValueError if the data in the form doesn't validate -- i.e., if form.errors evaluates to True."
It appears that save() shouldn't check validation. That's what is_valid() does, throwing a ValidationError if necessary.
Change History (7)
comment:1 by , 15 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 15 years ago
| Type: | → Bug |
|---|
comment:3 by , 15 years ago
| Severity: | → Normal |
|---|
comment:4 by , 14 years ago
| UI/UX: | unset |
|---|
comment:7 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Change UI/UX from NULL to False.