Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11278 closed (fixed)

Docs do not mention mod.m2m = [list, of, PKs]

Reported by: Zulq Alam <me@…> Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords: m2m, bulk
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The docs don't mention that it's possible to bulk assign to an m2m relationship using a list of primary key values.

mod.m2m = [pk1, pk2, pk3]

The docs do mention being able to do this with a list of models:

http://docs.djangoproject.com/en/dev/topics/db/queries/#following-relationships-backward

Attachments (1)

assign-related-objects.diff (551 bytes) - added by Jarek Zgoda 7 years ago.
patch for documentation on assigning iterable of PK's instead of model instances

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Jarek Zgoda

Attachment: assign-related-objects.diff added

patch for documentation on assigning iterable of PK's instead of model instances

comment:1 Changed 7 years ago by Jarek Zgoda

Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Attached patch against rev. 11012.

comment:2 Changed 7 years ago by Chris Beaven

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [11045]) Fixed #11278 -- Clarified query documentation regarding bulk assignment of m2m values. Thanks to zgoda for the patch.

comment:4 Changed 7 years ago by Russell Keith-Magee

(In [11057]) [1.0.X] Fixed #11278 -- Clarified query documentation regarding bulk assignment of m2m values. Thanks to zgoda for the patch.

Merge of r11045 and r11054 from trunk.

Note: See TracTickets for help on using tickets.
Back to Top