Changes between Initial Version and Version 1 of Ticket #28514
- Timestamp:
- Aug 21, 2017, 8:23:26 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28514
- Property Easy pickings set
- Property Triage Stage Unreviewed → Accepted
- Property Summary Documentating idempotence of Many2ManyField.add() → Clarify docs regarding idempotence of RelatedManager.add()
-
Ticket #28514 – Description
initial v1 1 At https://docs.djangoproject.com/en/1.11/topics/db/examples/many_to_many/ i s written:2 1 At https://docs.djangoproject.com/en/1.11/topics/db/examples/many_to_many/ it's written: 2 {{{ 3 3 >> a2.publications.add(p3) 4 4 > … … 6 6 > 7 7 >> a2.publications.add(p3) 8 8 }}} 9 9 Please rephrase it to "Adding a second time is OK, it doesn't duplicate the relation". 10 10 11 12 At https://docs.djangoproject.com/en/1.11/ref/models/relations/ is written: 13 11 At https://docs.djangoproject.com/en/1.11/ref/models/relations/ it's written: 12 {{{ 14 13 add(*objs, bulk=True) 15 14 Adds the specified model objects to the related object set. 16 15 }}} 17 16 Please amend: "Inserting existing relations this way does not cause problems." 18 17 19 The purpose of the changes is to make clear, that add()is idempotent and it is not necessary first to read the data from the database, join with the new values and eventually write the resulting set back.18 The purpose of the changes is to make clear, that `add()` is idempotent and it is not necessary first to read the data from the database, join with the new values and eventually write the resulting set back.