Opened 5 years ago

Closed 4 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 5 years ago by gabrielhurley

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by lrekucki

  • Severity set to Normal
  • Type set to Bug

comment:3 Changed 4 years ago by jammon

  • Easy pickings unset
  • Resolution set to wontfix
  • Status changed from new to closed
  • 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