Opened 7 years ago

Closed 6 years ago

#12251 closed (fixed)

QuerySet.in_bulk() should accept a set()

Reported by: emulbreh Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Alex)

--- django/db/models/	(revision 11751)
+++ django/db/models/	(working copy)
@@ -356,7 +356,7 @@
         assert self.query.can_filter(), \
                 "Cannot use 'limit' or 'offset' with in_bulk"
-        assert isinstance(id_list, (tuple, list)), \
+        assert isinstance(id_list, (tuple, list, set, frozenset)), \
                 "in_bulk() must be provided with a list of IDs."
         if not id_list:
             return {}

Attachments (1)

12251.queryset_in_bulk_set.diff (1.1 KB) - added by emulbreh 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by emulbreh

comment:1 Changed 7 years ago by anonymous

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by Alex

  • Description modified (diff)
  • Triage Stage changed from Unreviewed to Ready for checkin
  • Version changed from 1.1 to SVN

comment:3 Changed 6 years ago by lukeplant

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

(In [11915]) Fixed #12251 - QuerySet.in_bulk() should accept set/frozenset

Thanks to emulbreh for patch.

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