Opened 15 years ago

Closed 15 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: no UI/UX: no

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 15 years ago.
patch for documentation on assigning iterable of PK's instead of model instances

Download all attachments as: .zip

Change History (7)

by Jarek Zgoda, 15 years ago

Attachment: assign-related-objects.diff added

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

comment:1 by Jarek Zgoda, 15 years ago

Has patch: set

Attached patch against rev. 11012.

comment:2 by Chris Beaven, 15 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by Russell Keith-Magee, 15 years ago

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 by Russell Keith-Magee, 15 years ago

(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.

comment:5 by Tim Graham <timograham@…>, 7 years ago

In 1834490a:

Refs #11278 -- Clarified RelatedManager differences between reverse one-to-many and many-to-many relations.

comment:6 by Tim Graham <timograham@…>, 7 years ago

In 50fd5f57:

[2.0.x] Refs #11278 -- Clarified RelatedManager differences between reverse one-to-many and many-to-many relations.

Backport of 1834490a0c45a87b718c9ee84523a6d7ec6c15ee from master

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