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.
--
Ticket URL: <https://code.djangoproject.com/ticket/20859>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Cleanup/optimization
* component: Uncategorized => Documentation
* easy: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:1>
* owner: nobody => jimmysong
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:2>
* has_patch: 0 => 1
Comment:
Changed the example in the documentation. Pull request here:
https://github.com/django/django/pull/1434
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:3>
Comment (by jimmysong):
fixed the tab indent issue in pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:4>
Comment (by timo):
The warning refers to `ModelForm.clean()` while the example is for
`Model.clean()` which actually does not require calling `super` as it does
nothing. That said, I think the patch does help clarify the example, so
I'll merge it minus the `super` call.
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"94d7fed7750322e8b80402c1e731bab6d4509f2e"]:
{{{
#!CommitTicketReference repository=""
revision="94d7fed7750322e8b80402c1e731bab6d4509f2e"
Fixed #20859 - Clarified Model.clean() example.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"ea7bef318fd42411e3db057e888367ef52fb23c3"]:
{{{
#!CommitTicketReference repository=""
revision="ea7bef318fd42411e3db057e888367ef52fb23c3"
[1.6.x] Fixed #20859 - Clarified Model.clean() example.
Backport of 94d7fed775 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:7>
Comment (by aaugustin):
Oops, sorry for the bad report :|
--
Ticket URL: <https://code.djangoproject.com/ticket/20859#comment:8>