Opened 6 years ago

Closed 6 years ago

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

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by zgoda

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

comment:1 Changed 6 years ago by zgoda

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

Attached patch against rev. 11012.

comment:2 Changed 6 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 6 years ago by russellm

(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