mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Cleaned up the implementation of in_bulk
This commit is contained in:
		| @@ -498,9 +498,7 @@ class QuerySet(object): | |||||||
|                 "Cannot use 'limit' or 'offset' with in_bulk" |                 "Cannot use 'limit' or 'offset' with in_bulk" | ||||||
|         if not id_list: |         if not id_list: | ||||||
|             return {} |             return {} | ||||||
|         qs = self._clone() |         qs = self.filter(pk__in=id_list).order_by() | ||||||
|         qs.query.add_filter(('pk__in', id_list)) |  | ||||||
|         qs.query.clear_ordering(force_empty=True) |  | ||||||
|         return dict([(obj._get_pk_val(), obj) for obj in qs]) |         return dict([(obj._get_pk_val(), obj) for obj in qs]) | ||||||
|  |  | ||||||
|     def delete(self): |     def delete(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user