#28514: Clarify docs regarding idempotence of RelatedManager.add()
-------------------------------------+-------------------------------------
Reporter: Дилян Палаузов | Owner: Jezeniel
Type: | Zapanta
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Дилян Палаузов):
Any progress here?
I think only the concurrent aspect of .add() is missing:
* if two .add() are called in parallel with overlapping set of related
objects, one of them can fail with IntegrityError and has to be repeated.
This is caused by the fact that Django inserts the objects within a
transaction and only after the transaction is closed it can be determined
if the changes are permament. Django does not retry in this case
* When IntegrityError is thrown, m2m_changed is still sent for the
objects, that were supposed to be matched.
The latter is valid if I recall correctly the circumstances from five
months ago. The code can certainly be changed so that m2m_changed is not
sent, but it is better to document the current behaviour than doing
noting.
Jack, I would like to encourage you to use the opportunity and check the
implementation, while you describe it.
Apart from this my plan is to work with Django for one more month and I
will be glad if by then all concerns related to this ticket can be
clarified.
--
Ticket URL: <https://code.djangoproject.com/ticket/28514#comment:16>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.d12c8366ceca4ab43d148b9a1a33db98%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.