1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

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
This commit is contained in:
Adrian Holovaty 2006-05-04 04:09:23 +00:00
parent c6750acfe3
commit 2b551dec40

View File

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