From f5ab1320ed3acbbc8b8bc358a46f5ae1380deff9 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 17 Aug 2005 22:46:43 +0000 Subject: [PATCH] Fixed bug in manipulator_valid_rel_key() -- it assumed the related object's primary key was called 'id' git-svn-id: http://code.djangoproject.com/svn/django/trunk@530 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/meta/fields.py b/django/core/meta/fields.py index 30b5ef7c0c7..774c459279a 100644 --- a/django/core/meta/fields.py +++ b/django/core/meta/fields.py @@ -30,7 +30,7 @@ def manipulator_valid_rel_key(f, self, field_data, all_data): "Validates that the value is a valid foreign key" mod = f.rel.to.get_model_module() try: - mod.get_object(**{'id__iexact': field_data}) + mod.get_object(pk=field_data) except ObjectDoesNotExist: raise validators.ValidationError, "Please enter a valid %s." % f.verbose_name