Code

Opened 3 years ago

Closed 2 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

Description

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.)

Attachments (0)

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

comment:2 Changed 3 years ago by lrekucki

  • Severity set to Normal
  • Type set to Bug

comment:3 Changed 2 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.)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.