From f82e64c6b2ade3e70553b3ec2743dfaa7456ddb3 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 22 Oct 2005 21:18:53 +0000 Subject: Fixed #681 -- get_in_bulk no longer assumes PK fields are called id. Also added unit tests to confirm. Thanks, Jeremy Dunck git-svn-id: http://code.djangoproject.com/svn/django/trunk@991 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/testapp/models/custom_pk.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/testapp') diff --git a/tests/testapp/models/custom_pk.py b/tests/testapp/models/custom_pk.py index 234b5c3308..5b0eb45462 100644 --- a/tests/testapp/models/custom_pk.py +++ b/tests/testapp/models/custom_pk.py @@ -53,6 +53,8 @@ EmployeeDoesNotExist: Employee does not exist for {'pk': 'foo'} >>> fran.save() >>> employees.get_list(last_name__exact='Jones') [Dan Jones, Fran Jones] +>>> employees.get_in_bulk(['ABC123', 'XYZ456']) +{'XYZ456': Fran Jones, 'ABC123': Dan Jones} >>> b = businesses.Business(name='Sears') >>> b.save() @@ -62,4 +64,6 @@ True [Dan Jones, Fran Jones] >>> fran.get_business_list() [Sears] +>>> businesses.get_in_bulk(['Sears']) +{'Sears': Sears} """ -- cgit v1.3