From d93c68ab5fbd7a426845c4f51ae1588f7d928b84 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 7 Oct 2005 23:39:06 +0000 Subject: [PATCH] Fixed #586 -- Fixed bug in raw_id_admin caused by [785]. Thanks for the heads-up, slashzero git-svn-id: http://code.djangoproject.com/svn/django/trunk@800 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/fields.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django/core/meta/fields.py b/django/core/meta/fields.py index b13518c503..376595230c 100644 --- a/django/core/meta/fields.py +++ b/django/core/meta/fields.py @@ -596,8 +596,9 @@ class ForeignKey(Field): Field.__init__(self, **kwargs) def get_manipulator_field_objs(self): - if self.rel.raw_id_admin: - return self.rel.get_related_field().get_manipulator_field_objs() + rel_field = self.rel.get_related_field() + if self.rel.raw_id_admin and not isinstance(rel_field, AutoField): + return rel_field.get_manipulator_field_objs() else: return [formfields.IntegerField]