Ticket #12348: widgets.py.diff
File widgets.py.diff, 608 bytes (added by , 15 years ago) |
---|
-
widgets.py
old new 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):