#25883: Admin Delete Page Incorrectly Counts Related Objects
-------------------------------+--------------------
     Reporter:  jpulec         |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.9
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 In the case where we're deleting an object (A) that has dependent foreign
 object (B) that points to it, and a different dependent foreign object (C)
 that also has B as a dependent foreign object, the admin will incorrectly
 double count this object. As an example:

 {{{
 class Spam(models.Model):
   pass

 class Egg(models.Model):
   spam = ForeignKey(Spam)

 class Shrubbery(models.Model):
   spam = ForeignKey(Spam)
   egg = ForeignKey(Egg)

 spam = Spam.objects.create()
 egg = Egg.objects.create(spam=spam)
 shrubbery = Shrubbery.objects.create(spam=spam, egg=egg)
 }}}

 If we issue a delete on an instance of Spam in this case, the admin will
 state that we are deleting 2 instances of Shrubbery, even though we are
 really only deleting 1 instance of Shrubbery that is attached both
 directly to the instance of Spam, and to the instance of Egg that is a
 dependent object of spam.

--
Ticket URL: <https://code.djangoproject.com/ticket/25883>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.f88cb0f178ac1870481612722c02fbeb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to