1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #9258 -- Use _default_manager in ForeignKeyRawIdWidget.label_for_value. Thanks nullie for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9444 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Brian Rosner
2008-11-15 02:20:00 +00:00
parent 0349d83289
commit f63929dbe2
2 changed files with 16 additions and 1 deletions

View File

@@ -146,7 +146,7 @@ class ForeignKeyRawIdWidget(forms.TextInput):
def label_for_value(self, value):
key = self.rel.get_related_field().name
obj = self.rel.to.objects.get(**{key: value})
obj = self.rel.to._default_manager.get(**{key: value})
return '&nbsp;<strong>%s</strong>' % truncate_words(obj, 14)
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):