diff --git a/AUTHORS b/AUTHORS index d6547cd919..92581cf547 100644 --- a/AUTHORS +++ b/AUTHORS @@ -79,6 +79,7 @@ answer newbie questions, and generally made Django that much better: Robin Munn Nebojša Dorđević Sam Newman + oggie rob pgross@thoughtworks.com phaedo Luke Plant diff --git a/django/contrib/admin/views/stages/delete.py b/django/contrib/admin/views/stages/delete.py index 7537b83a50..80fb0a8f7b 100644 --- a/django/contrib/admin/views/stages/delete.py +++ b/django/contrib/admin/views/stages/delete.py @@ -61,7 +61,7 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current else: # Display a link to the admin page. nh(deleted_objects, current_depth, ['%s: %s' % \ - (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.module_name, sub_obj.id, strip_tags(str(sub_obj))), []]) + (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.module_name, getattr(sub_obj, related.opts.pk.attname), strip_tags(str(sub_obj))), []]) _get_deleted_objects(deleted_objects, perms_needed, user, sub_obj, related.opts, current_depth+2) # If there were related objects, and the user doesn't have # permission to delete them, add the missing perm to perms_needed. @@ -87,7 +87,7 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current nh(deleted_objects, current_depth, [ (_('One or more %(fieldname)s in %(name)s:') % {'fieldname': related.field.name, 'name':related.opts.verbose_name}) + \ (' %s' % \ - (related.opts.app_label, related.opts.module_name, sub_obj.id, strip_tags(str(sub_obj)))), []]) + (related.opts.app_label, related.opts.module_name, getattr(sub_obj, related.opts.pk.attname), strip_tags(str(sub_obj)))), []]) # If there were related objects, and the user doesn't have # permission to change them, add the missing perm to perms_needed. if related.opts.admin and has_related_objs: