﻿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
23646	query set sql update to change different values by different keys	Brillgen Developers	nobody	"Database backends like Postgresql support doing multiple value update for the same field in different rows using a single update query. Please see this sample below:

http://stackoverflow.com/questions/18797608/update-multiple-rows-in-same-query-using-postgresql

Example:
Currently:
{{{
Books.objects.all().update(price=10)
}}}

Proposed (syntax can vary):
{{{
Books.objects.all().update({'pk': 1, 'price': 10}, {'pk': 2, 'price': 25}])
}}}

Idea is to do it in sql for performance reasons but still use the ORM and not use a raw database connection.

However, such an interface is not exposed via the Django ORM. Would this be accepted as a patch? if so, would a list dictionary with the various fields:values to be updated be a good way to provide the input to ORM "	New feature	new	Database layer (models, ORM)	1.7	Normal				Unreviewed	0	0	0	0	0	0
