467 | | if related.field.rel.edit_inline or not related.opts.admin: |
468 | | # Don't display link to edit, because it either has no |
469 | | # admin or is edited inline. |
470 | | nh(deleted_objects, current_depth, [_('One or more %(fieldname)s in %(name)s: %(obj)s') % \ |
471 | | {'fieldname': related.field.verbose_name, 'name': related.opts.verbose_name, 'obj': escape(str(sub_obj))}, []]) |
472 | | else: |
473 | | # Display a link to the admin page. |
474 | | nh(deleted_objects, current_depth, [ |
475 | | (_('One or more %(fieldname)s in %(name)s:') % {'fieldname': related.field.verbose_name, 'name':related.opts.verbose_name}) + \ |
476 | | (' <a href="../../../../%s/%s/%s/">%s</a>' % \ |
477 | | (related.opts.app_label, related.opts.module_name, sub_obj._get_pk_val(), escape(str(sub_obj)))), []]) |
| 469 | |
| 470 | if has_related_objs: |
| 471 | for sub_obj in rel_objs.all(): |
| 472 | if related.field.rel.edit_inline or not related.opts.admin: |
| 473 | # Don't display link to edit, because it either has no |
| 474 | # admin or is edited inline. |
| 475 | nh(deleted_objects, current_depth, [_('One or more %(fieldname)s in %(name)s: %(obj)s') % \ |
| 476 | {'fieldname': related.field.verbose_name, 'name': related.opts.verbose_name, 'obj': escape(str(sub_obj))}, []]) |
| 477 | else: |
| 478 | # Display a link to the admin page. |
| 479 | nh(deleted_objects, current_depth, [ |
| 480 | (_('One or more %(fieldname)s in %(name)s:') % {'fieldname': related.field.verbose_name, 'name':related.opts.verbose_name}) + \ |
| 481 | (' <a href="../../../../%s/%s/%s/">%s</a>' % \ |
| 482 | (related.opts.app_label, related.opts.module_name, sub_obj._get_pk_val(), escape(str(sub_obj)))), []]) |