#13416: Generic relations should be counted as children when deleting to avoid
problems with post_delete signal
------------------------------------+---------------------------------------
          Reporter:  rfugger        |         Owner:  nobody
            Status:  closed         |     Milestone:        
         Component:  Uncategorized  |       Version:  SVN   
        Resolution:  wontfix        |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by rfugger):

 I agree that your third option, let the post_delete handler check to make
 sure the parent hasn't been deleted, is the best workaround, since it
 doesn't require messing with other models.  However, since ticket #5559
 deleted objects aren't marked as such until after their children are
 deleted, so it does require another query to determine whether the
 instance still exists in the db.  My proposed solution is more efficient
 since it doesn't require any more queries, or really change much or
 anything except the order in which model groups are deleted.

 I've attached a patch showing the one-line change that appears to fix my
 issue.

 I suppose there is a risk that my solution would cause other problems, but
 I can't think what they would be.  I'll start a discussion on django-dev
 to see if anyone can point out a problem here.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to