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:
@@ -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 ' <strong>%s</strong>' % truncate_words(obj, 14)
|
||||
|
||||
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
|
||||
|
||||
Reference in New Issue
Block a user