Re: queryset .all() behavior change in 3.2

2021-07-13 Thread Riccardo Magliocchetti
Hi Uri, I'm not arguing that the code was correct :) I'm just reporting a reproducible change in behavior. The tests did run fine with 2.2 and 3.1 and bumping to 3.2 required a code change. Thanks On 13/07/21 17:07, אורי wrote: Hi Riccardo, It looks to me that *obj.relatedobj_set.all()* ha

Re: queryset .all() behavior change in 3.2

2021-07-13 Thread אורי
Hi Riccardo, It looks to me that *obj.relatedobj_set.all()* has to be evaluated before setting *obj.pk = None*. *for* and *list()* causes it to be evaluated. So it's better programming to evaluate it on the lines above setting *obj.pk = None*. I'm not sure how it is

queryset .all() behavior change in 3.2

2021-07-13 Thread Riccardo Magliocchetti
Hello, when porting a django application from 3.1.13 to 3.2.5 I found a behavior change I don't see documented in the release notes. The code is cloning a an object and all its related objects by settings the pk to None. Previously storing a queryset of related objects was enough to being ab