﻿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
4102	Allow UPDATE of only specific fields in model.save()	Collin Grady <cgrady@…>	Collin Grady	"At present, django updates every single field when saving - this can be less than desirable performance-wise if you only need to update 1 or 2, and can help avoid some minor threading issues. (two functions that never edit the same columns can never conflict with each other using this)

This patch allows you to specify which columns should be saved, and the rest are left as they currently are in the database.

Example:

{{{
>>> p = Poll.objects.get(pk=1)
>>> p.question = ""How can we help you?""
>>> p.save(['question']) # or p.save(save_fields=['question'])
}}}

The SQL generated is then only touching the question:

'UPDATE ""polls_poll"" SET ""question""=How can we help you? WHERE ""id""=1'

(from connection.queries, which is why the quoting isn't complete)"	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	update fields sql  row table modified	yannvr@… simon@… andrewbadr.etc@… dcramer@… philippe.r@… hv@… jashugan@… gav@… richard.davies@… omat@… hwaara@… andrehcampos@… miracle2k graham@… nikitka@… wwbj2r68n2@… Alexander Koshelev Béres Botond cg@… simon@… maxirobaina@… kmike84@… sfllaw@… anssi.kaariainen@… dtran German M. Bravo Matt Long bitwolaiye inactivist@… niwi@…	Ready for checkin	1	0	0	0	0	0
