Opened 2 years ago

Last modified 2 years ago

#29440 closed Bug

RelatedManager.set() doesn't accept bulk keyword argument for many-to-many relations — at Version 1

Reported by: Jeremy Lainé Owned by: nobody
Component: Documentation Version: 2.0
Severity: Normal Keywords:
Cc: Bartosz Grabski Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Jeremy Lainé)

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

Change History (1)

comment:1 Changed 2 years ago by Jeremy Lainé

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top