On Tuesday, January 26, 2021 at 5:26:02 PM UTC+1 Adam Johnson wrote: > Not that I am completely convinced that the following is a good idea; but >> what about: > > QuerySet.objects.update(name="Rob").values("id", "name") >> > > That's not possible since update() directly performs the update - it's not > lazy in any way. It could be done in the other order like > `QuerySet.objects.values("id", "name").update(name="Rob")` but I don't see > the necessity to define "returning" fields in a chainable manner. >
Ha, not sure what I was thinking. The sentence below I noted that update() would return something but I didn't think that this would break chaining. My bad. I looked further around and `get_or_create` has the nice workaround of being able to use `defaults__exact` if it clashes with the `defaults` keyword. Sadly we do not have that option here. Truth to be told I do not think that many people have fields called returning -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/37efe4e9-4ca7-4ad7-b370-94dd2d27fc86n%40googlegroups.com.