#29440: RelatedManager.set() doesn't accept bulk keyword argument for many-to-many relations -------------------------------------+------------------------------------- Reporter: Jeremy Lainé | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 2.0 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Description changed by Jeremy Lainé:
Old description: > Since Django 2.0, trying to pass bulk=True to a many-to-many > RelatedManager results in an error: > > ```TypeError: set() got an unexpected keyword argument 'bulk'``` > > The documentation however still states that the "bulk" argument exists, > so I'm not sure whether the documentation or the code is wrong. > > Looking at the django code, the set() method for reverse many-to-one, and > forward many-to-many relations don't have the same signature. > > In `create_reverse_many_to_one_manager`: > > ```def set(self, objs, *, bulk=True, clear=False):``` > > In `create_forward_many_to_many_manager`: > > ```def set(self, objs, *, clear=False)``` New description: Since Django 2.0, trying to pass bulk=True to a many-to-many RelatedManager results in an error: `TypeError: set() got an unexpected keyword argument 'bulk'` The documentation however still states that the "bulk" argument exists, so I'm not sure whether the documentation or the code is wrong. Looking at the django code, the set() method for reverse many-to-one, and forward many-to-many relations don't have the same signature. In `create_reverse_many_to_one_manager`: `def set(self, objs, *, bulk=True, clear=False):` In `create_forward_many_to_many_manager`: `def set(self, objs, *, clear=False):` -- -- Ticket URL: <https://code.djangoproject.com/ticket/29440#comment:1> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.76cc3d4fd37faf6c00f78bbe536fd4f6%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.