Ticket #2856: t2856.diff
File t2856.diff, 1.5 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/templates/admin/index.html
63 63 {% if entry.is_deletion %} 64 64 {{ entry.object_repr }} 65 65 {% else %} 66 <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a> 66 {% if entry.edited_object_still_exists %} 67 <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a> 68 {% else %} 69 {{ entry.object_repr }} 70 {% endif %} 67 71 {% endif %} 68 72 <br/> 69 73 {% if entry.content_type %} -
django/contrib/admin/models.py
52 52 This is relative to the Django admin index page. 53 53 """ 54 54 return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id))) 55 56 def edited_object_still_exists(self): 57 "Check whether the edited object has been removed by a subsequent action" 58 try: 59 self.content_type.get_object_for_this_type(pk=self.object_id) 60 return True 61 except Exception: 62 return False