#16128: cascade delete does not work for proxy models
-------------------------------------+-------------------------------------
               Reporter:  xkennyx@…  |          Owner:  nobody
                   Type:  Bug        |         Status:  reopened
              Milestone:             |      Component:  Database layer
                Version:  1.3        |  (models, ORM)
             Resolution:             |       Severity:  Normal
           Triage Stage:  Accepted   |       Keywords:  cascade delete
    Needs documentation:  0          |  proxy meta
Patch needs improvement:  0          |      Has patch:  1
                  UI/UX:  0          |    Needs tests:  0
                                     |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by claudep):

 * has_patch:  0 => 1


Comment:

 I've been bitten by this bug. In fact, aaugustin's patch (16128.3.patch)
 is not exactly related to this issue. It might be a bug (not sure), but in
 that case, it's the problem of the non-proxy class not seeing at all the
 related proxy objects.

 In this bug, the issue is about sorting objects before deletion, based on
 the dependencies structure. The keys of ''dependencies'' dict are
 constructed by accessing the rel.to attribute which is not a proxy class.

 I used your test case, but simplified it. It fails only with MySql-Innodb,
 but might also fail on Postgres (if somebody knows how to really commit
 the objects in the DB inside the test case to trigger the IntegrityError,
 before the delete call).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16128#comment:8>
Django <https://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-updates@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