Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1312 -- made QuerySet.in_bulk() accepting of an…

…y iterable, not just lists

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 124944e5ededdfab22d37ca7f102ff29c44ad112 1 parent b78f2a9
Adrian Holovaty authored February 02, 2006

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  django/db/models/query.py
6  django/db/models/query.py
@@ -199,7 +199,11 @@ def delete(self, *args, **kwargs):
199 199
     ##################################################
200 200
 
201 201
     def in_bulk(self, id_list):
202  
-        assert isinstance(id_list, list), "in_bulk() must be provided with a list of IDs."
  202
+        try:
  203
+            iter(id_list)
  204
+        except TypeError:
  205
+            assert False, "in_bulk() must be provided with a list of IDs."
  206
+        id_list = list(id_list)
203 207
         assert id_list != [], "in_bulk() cannot be passed an empty ID list."
204 208
         return self._clone(klass=InBulkQuerySet, _id_list=id_list)
205 209
 

0 notes on commit 124944e

Please sign in to comment.
Something went wrong with that request. Please try again.