Please document the behaviour of RelatedManager when the same object is added twice
|Reported by:||jammon||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
As I understand the code in django.db.models.fields.related the _add_items method of ManyRelatedManager takes care that the same object isn't added twice.
So I suggest to document that in /ref/models/relations/#django.db.models.fields.related.RelatedManager.add, maybe like this: "Adding a model that is already in the related object set has no effect, it won't be contained twice afterwards."
(I looked it up in the code, but just a year ago that would have been difficult for me.)
Change History (3)
comment:1 Changed 3 years ago by gabrielhurley
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted