Re: [Django] #27585: ManyToMany relationship is cascading delete after being detached

2020-05-22 Thread Django
#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()):
 cat.article_set.remove(article)

 # This deleted all articles that were in the category but were already
 removed()
 cat.delete()
 }}}

-- 
Ticket URL: 
Django 
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 
https://groups.google.com/d/msgid/django-updates/066.3166137b991cb0e66b63feaf1d66ca66%40djangoproject.com.


Re: [Django] #27585: ManyToMany relationship is cascading delete after being detached

2016-12-09 Thread Django
#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
-+-
Changes (by Teresa):

 * status:  new => closed
 * resolution:   => invalid


--
Ticket URL: 
Django 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.7da0c0ac869c4ed779d3e3954f445e4c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27585: ManyToMany relationship is cascading delete after being detached

2016-12-09 Thread Django
#27585: ManyToMany relationship is cascading delete after being detached
-+-
 Reporter:  Teresa   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.8
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 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 Tim Graham):

 Could you please provide a sample app with models and tests we could
 download to reproduce? The example code doesn't run as `b.as.all()` is a
 `SyntaxError`.

--
Ticket URL: 
Django 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.6fb5abfca69d8c3dc19940bfa3e3f09e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27585: ManyToMany relationship is cascading delete after being detached

2016-12-09 Thread Django
#27585: ManyToMany relationship is cascading delete after being detached
-+-
 Reporter:  Teresa   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.8
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 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
-+-
Changes (by Teresa):

 * status:  closed => new
 * resolution:  invalid =>


Comment:

 An additional detail:

 The models also have a ManyToOne foreign key constraint. But when that
 relationship has also been removed, the now unattached 'a's are deleted.

--
Ticket URL: 
Django 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.8e24aeb89827c28c5cbdfb12c912a321%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27585: ManyToMany relationship is cascading delete after being detached

2016-12-09 Thread Django
#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
-+-
Changes (by Teresa):

 * status:  new => closed
 * resolution:   => invalid


--
Ticket URL: 
Django 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.b56213ca38c574c2c2dfef07efc5e877%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.