Opened 16 years ago
Closed 16 years ago
#12251 closed (fixed)
QuerySet.in_bulk() should accept a set()
| Reported by: | Johannes Dollinger | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Keywords: | ||
| 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 (last modified by )
--- django/db/models/query.py (revision 11751)
+++ django/db/models/query.py (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)
Change History (4)
by , 16 years ago
| Attachment: | 12251.queryset_in_bulk_set.diff added |
|---|
comment:1 by , 16 years ago
| Component: | Uncategorized → Database layer (models, ORM) |
|---|---|
| Has patch: | set |
comment:2 by , 16 years ago
| Description: | modified (diff) |
|---|---|
| Triage Stage: | Unreviewed → Ready for checkin |
| Version: | 1.1 → SVN |
comment:3 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [11915]) Fixed #12251 - QuerySet.in_bulk() should accept set/frozenset
Thanks to emulbreh for patch.