Django

Code

Ticket #7483 (closed: fixed)

Opened 4 months ago

Last modified 4 months ago

[newforms-admin] Delete view doesn't link to related objects

Reported by: Daniel Roseman <daniel@roseman.org.uk> Assigned to: nobody
Milestone: 1.0 alpha Component: django.contrib.admin
Version: newforms-admin Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by ramiro)

The get_deleted_objects function in django.contrib.admin.util lists the related objects that will be affected by a delete operation. It contains code to link each item to its actual admin page. However, this is never called because in order to check if the model has an admin page, it checks has_admin = related.__class__ in admin_site._registry - but related.__class__ is always <class 'django.db.models.related.RelatedObject'>, which naturally does not match anything in _registry. This needs to be changed to related.model, which does work.

Patch includes this change, plus big changes to the admin_views regression test and fixture to set up a related model to test this against.

Attachments

delete_related.diff (5.6 kB) - added by Daniel Roseman <daniel@roseman.org.uk> on 06/17/08 11:31:15.
Patch and updated tests/fixtures

Change History

06/17/08 11:31:15 changed by Daniel Roseman <daniel@roseman.org.uk>

  • attachment delete_related.diff added.

Patch and updated tests/fixtures

06/17/08 19:10:50 changed by ramiro

  • needs_better_patch changed.
  • description changed.
  • needs_tests changed.
  • needs_docs changed.

06/18/08 04:00:12 changed by simon

  • status changed from new to closed.
  • resolution set to fixed.

(In [7685]) newforms-admin: Fixed #7483 (thanks, Daniel Roseman) - delete view now correctly links to related objects


Add/Change #7483 ([newforms-admin] Delete view doesn't link to related objects)




Change Properties
Action