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
This commit is contained in:
Adrian Holovaty 2005-08-17 22:46:43 +00:00
parent b1d9682a38
commit f5ab1320ed
1 changed files with 1 additions and 1 deletions

View File

@ -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