﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33841	Django shouldn't fail (bulk-)update silently when QuerySet is already evaluated.	Shibel Karmi Mansour	nobody	"The following code:

{{{
initial_queryset = MyObject.objects.filter(...)
filtered_queryset = initial_queryset.exclude(related_model__id__in=...)
for_loop_on_filtered = [MyOtherModel(some_id=..., other_id=...) for x in
                          filtered_queryset]
MyOtherModel.objects.bulk_create(for_loop_on_filtered)
filtered_queryset.update(processed=True) # silent failure to update
}}}

Fails to update all objects in `filtered_queryset`. It seems like the reason is the list-comprehension on `filtered_queryset`. 
I've been with Django for >6 years and this is by far the most surprising behavior I've seen.

It does seem to be documented (?): 

""You cannot call update() on a QuerySet that has had a slice taken or can otherwise no longer be filtered.""

But the fact is I can and did call `update()` on that QuerySet, and Django returned 0 errors.

If that is the intended behavior, then I suggest updating the documentation."	Uncategorized	closed	Database layer (models, ORM)	3.2	Normal	worksforme	update, bulk-update, queryset		Unreviewed	0	0	0	0	0	0
