﻿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
4459	loaddata failure if model has overridden save() method	Russell Keith-Magee	Russell Keith-Magee	"If a model overrides the save() method, and performs a query in that save(), loaddata may fail when objects of that type are  loaded. dumpdata/loaddata don't preserve dependency order (they can't really, because there could easily be circular dependencies), so loaddata can't guarantee that the subject of the search will have been deserialized yet.

I suspect that the fix for this is to introduce a 'raw save' - a guaranteed use of the original Model.save(), rather than the model's overidden variant. 

raw_save should proabably also avoid running pre-save methods on fields - these methods can mutate the data as part of the load (e.g., you can't correctly deserialize an auto_add_now field, as deserializing will update the field).

The errors reported by #4431 are a direct cause of this problem."		closed	Core (Serialization)	dev		fixed			Unreviewed	0	0	0	0	0	0
