From 124944e5ededdfab22d37ca7f102ff29c44ad112 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 2 Feb 2006 04:38:45 +0000 Subject: [PATCH] magic-removal: Fixed #1312 -- made QuerySet.in_bulk() accepting of any iterable, not just lists git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2221 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/query.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index a4778dd3cd..ea05043a84 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -199,7 +199,11 @@ class QuerySet(object): ################################################## def in_bulk(self, id_list): - assert isinstance(id_list, list), "in_bulk() must be provided with a list of IDs." + try: + iter(id_list) + except TypeError: + assert False, "in_bulk() must be provided with a list of IDs." + id_list = list(id_list) assert id_list != [], "in_bulk() cannot be passed an empty ID list." return self._clone(klass=InBulkQuerySet, _id_list=id_list)