1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

magic-removal: Cleaned up get_in_bulk() and __get_date_list() DB queries to match documentation and improve error checking.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2006-01-09 14:34:17 +00:00
parent dde6963869
commit 0389e6261b
3 changed files with 28 additions and 17 deletions

View File

@@ -69,6 +69,18 @@ Article 4
Traceback (most recent call last):
...
AssertionError: get_in_bulk() cannot be passed an empty ID list.
>>> Article.objects.get_in_bulk('foo')
Traceback (most recent call last):
...
AssertionError: get_in_bulk() must be provided with a list of IDs.
>>> Article.objects.get_in_bulk()
Traceback (most recent call last):
...
TypeError: get_in_bulk() takes at least 2 arguments (1 given)
>>> Article.objects.get_in_bulk(headline__startswith='Blah')
Traceback (most recent call last):
...
TypeError: get_in_bulk() takes at least 2 non-keyword arguments (1 given)
# get_values() is just like get_list(), except it returns a list of
# dictionaries instead of object instances -- and you can specify which fields