From 2b551dec408dae44f3e9a75a3e7fe2128cc4bd52 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 4 May 2006 04:09:23 +0000 Subject: [PATCH] Fixed bug in admin: raw_id_admin fields weren't displaying their old values next to the form field, due to descriptor-fields change git-svn-id: http://code.djangoproject.com/svn/django/trunk@2827 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/views/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 9913914858..0ba9d260a0 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -143,9 +143,9 @@ class AdminBoundField(object): return self._display except AttributeError: if isinstance(self.field.rel, models.ManyToOneRel): - self._display = getattr(self.original, 'get_%s' % self.field.name)() + self._display = getattr(self.original, self.field.attname) elif isinstance(self.field.rel, models.ManyToManyRel): - self._display = ", ".join([str(obj) for obj in getattr(self.original, 'get_%s_list' % self.field.rel.singular)()]) + self._display = ", ".join([str(obj) for obj in getattr(self.original, self.field.attname).all()]) return self._display def __repr__(self):