Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion #6191: Admin delete view doesn't show all items in some circumstances
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Django  
View profile  
 More options Jan 10 2010, 7:25 pm
From: "Django" <nore...@djangoproject.com>
Date: Mon, 11 Jan 2010 00:25:36 -0000
Local: Sun, Jan 10 2010 7:25 pm
Subject: Re: [Django] #6191: Admin delete view doesn't show all items in some circumstances
#6191: Admin delete view doesn't show all items in some circumstances
-------------------------------------------+------------------------------- -
          Reporter:  nicklane              |         Owner:  carljm    
            Status:  new                   |     Milestone:            
         Component:  django.contrib.admin  |       Version:  SVN        
        Resolution:                        |      Keywords:  nfa-someday
             Stage:  Accepted              |     Has_patch:  1          
        Needs_docs:  0                     |   Needs_tests:  0          
Needs_better_patch:  1                     |  
-------------------------------------------+------------------------------- -
Comment (by carljm):

 The attached patch is based on nicklane's 6191.patch, updated to apply to
 trunk, and with a number of new tests. Just uploading for the tests; I
 don't think the fix is ready for trunk.

 Notably (among other things), the new tests test that:

 1. If a model has two foreign keys to it from a single related model, both
 are followed (the original issue here, passes after the patch).

 2. A given object is only displayed once in the list, even if it can be
 found through two different paths (passes before the patch, fails after
 it).

 3. A cyclic dependency still only lists each object once, not repeatedly
 until an arbitrary max recursion is hit (this is #11296, currently fails
 both before and after).

 IMO, kmtracey is right: the real fix here is to re-use the same code that
 is actually used to collect the objects for deletion (that's
 Model._collect_sub_objects). Otherwise we're likely to continue to see
 recurring problems with mismatches between the two duplicate algorithms.
 It's tricky, because get_deleted_objects generates a nested data structure
 for display, where Model._collect_sub_objects generates a flat one. I
 think it's possible by adding a callback hook to
 Model._collect_sub_objects, so get_deleted_objects can be notified each
 time _collect_sub_objects recurses. This is the route I'm planning to
 pursue, and I think I should be able to get all three of the above cases
 to pass (fixing both this and #11296), and eliminate the duplicate logic.
 Comments welcome.

--
Ticket URL: <http://code.djangoproject.com/ticket/6191#comment:15>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.