def object_repr_link(self, obj):
if obj.event_type == CRUDEvent.DELETE:
html = obj.object_repr
else:
try:
url = urlresolvers.reverse("admin:%s_%s_change" % (
obj.content_type.app_label,
obj.content_type.model,
), args=(obj.object_id,))
html = '<a href="%s">%s</a>' % (url, obj.object_repr)
except:
html = obj.object_repr
return mark_safe(html)
评论列表
文章目录