#27585: ManyToMany relationship is cascading delete after being detached
     Reporter:  Teresa               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  ManyToMany,          |             Triage Stage:
  cascade, delete, remove            |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0

Comment (by Matt):

 This problem just happened to me on Django 2.2.12 in a migration. e.g.

 Category = apps.get_model('blog', 'Category')

 cat = Category.objects.filter(name='Cat A').first()

 for article in list(cat.article_set.all()):

 # This deleted all articles that were in the category but were already

Ticket URL: <https://code.djangoproject.com/ticket/27585#comment:5>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to