-
Notifications
You must be signed in to change notification settings - Fork 493
Closed
Labels
acceptedIssue accepted for completionIssue accepted for completionbugIssues related to confirmed bugsIssues related to confirmed bugs
Description
If I have the models e.g. User
and Group
where Group
has an m2m field to User
and also has a field like history = HistoricalRecords(m2m_fields=[users])
, calling any of the m2m set update methods such as group.users.set(users)
or group.users.add(user1, user2)
causes duplicate queries.
I have an example of this where I add 25 users to a group, and it generates 25 extra user selects and 25 extra group selects.
Is there any way to work around this? Since I do this right after creating a new Group
, I tried bypassing history saving on the Group
model as suggested by the documentation, but related sets seem unaffected by this.
Metadata
Metadata
Assignees
Labels
acceptedIssue accepted for completionIssue accepted for completionbugIssues related to confirmed bugsIssues related to confirmed bugs