Opened 7 years ago

Closed 6 years ago

#15339 closed Bug (wontfix)

Please document the behaviour of RelatedManager when the same object is added twice

Reported by: jammon Owned by: nobody
Component: Documentation Version: 1.3-beta
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: 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 7 years ago by Gabriel Hurley

Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Łukasz Rekucki

Severity: Normal
Type: Bug

comment:3 Changed 6 years ago by jammon

Easy pickings: unset
Resolution: wontfix
Status: newclosed
UI/UX: unset

Sorry, please forget it. It was a linguistic problem on my side. (It's just the way sets work.)

Note: See TracTickets for help on using tickets.
Back to Top