Ticket #11465: patch.diff
File patch.diff, 654 bytes (added by , 15 years ago) |
---|
-
contrib/admin/widgets.py
147 147 148 148 def label_for_value(self, value): 149 149 key = self.rel.get_related_field().name 150 obj = self.rel.to._default_manager.get(**{key: value}) 150 try: 151 obj = self.rel.to._default_manager.get(**{key: value}) 152 except self.rel.to.DoesNotExist: 153 return '' 151 154 return ' <strong>%s</strong>' % truncate_words(obj, 14) 152 155 153 156 class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):