Ticket #15792: databrowse.datastructures.diff
File databrowse.datastructures.diff, 1.2 KB (added by , 14 years ago) |
---|
-
django/contrib/databrowse/datastructures.py
old new 9 9 from django.utils.encoding import smart_unicode, smart_str, iri_to_uri 10 10 from django.utils.safestring import mark_safe 11 11 from django.db.models.query import QuerySet 12 from exceptions import AttributeError 12 13 13 14 EMPTY_VALUE = '(None)' 14 15 DISPLAY_SIZE = 100 … … 184 185 if self.field.rel.to in self.model.model_list: 185 186 lst = [] 186 187 for value in self.values(): 187 url = mark_safe('%s%s/%s/objects/%s/' % (self.model.site.root_url, m.model._meta.app_label, m.model._meta.module_name, iri_to_uri(value._get_pk_val()))) 188 try: 189 url = mark_safe('%s%s/%s/objects/%s/' % (self.model.site.root_url, m.model._meta.app_label, m.model._meta.module_name, iri_to_uri(value._get_pk_val()))) 190 except AttributeError: 191 url = None 188 192 lst.append((smart_unicode(value), url)) 189 193 else: 190 194 lst = [(value, None) for value in self.values()]