Changeset 1834
- Timestamp:
- 01/06/06 14:43:14 (3 years ago)
- Files:
-
- django/trunk/AUTHORS (modified) (1 diff)
- django/trunk/django/core/meta/__init__.py (modified) (1 diff)
- django/trunk/tests/testapp/models/lookup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/AUTHORS
r1581 r1834 32 32 answer newbie questions, and generally made Django that much better: 33 33 34 akaihola 34 35 Andreas 35 36 David Ascher <http://ascher.ca/> django/trunk/django/core/meta/__init__.py
r1717 r1834 1650 1650 1651 1651 def function_get_in_bulk(opts, klass, *args, **kwargs): 1652 id_list = args and args[0] or kwargs ['id_list']1652 id_list = args and args[0] or kwargs.get('id_list', []) 1653 1653 assert id_list != [], "get_in_bulk() cannot be passed an empty list." 1654 1654 kwargs['where'] = ["%s.%s IN (%s)" % (db.db.quote_name(opts.db_table), db.db.quote_name(opts.pk.column), ",".join(['%s'] * len(id_list)))] django/trunk/tests/testapp/models/lookup.py
r1324 r1834 66 66 >>> articles.get_in_bulk([1000]) 67 67 {} 68 >>> articles.get_in_bulk([]) 69 Traceback (most recent call last): 70 ... 71 AssertionError: get_in_bulk() cannot be passed an empty list. 68 72 69 73 # get_values() is just like get_list(), except it returns a list of
