Example for Model.clean doesn't call parent method
|Reported by:||aaugustin||Owned by:||jimmysong|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-clean-method warns that if one customizes the clean() method for a model, one should call the parent method to maintain default validation.
https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.clean shows an example which doesn't call the parent method.
I think the example should be modified to take this best practice into account.
Change History (8)
comment:1 Changed 2 years ago by timo
- Component changed from Uncategorized to Documentation
- Easy pickings set
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Uncategorized to Cleanup/optimization
comment:2 Changed 2 years ago by jimmysong
- Owner changed from nobody to jimmysong
- Status changed from new to assigned
comment:6 Changed 2 years ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from assigned to closed