Changes between Initial Version and Version 1 of Ticket #7483


Ignore:
Timestamp:
06/17/2008 07:10:50 PM (7 years ago)
Author:
ramiro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7483

    • Property Patch needs improvement unset
    • Property Needs tests unset
    • Property Needs documentation unset
  • Ticket #7483 – Description

    initial v1  
    1 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.
     1The 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.
    22
    33Patch includes this change, plus big changes to the admin_views regression test and fixture to set up a related model to test this against.
Back to Top