﻿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
2288	Provide an equivalent for 'ON DELETE' and friends	James Bennett	nobody	"A couple threads on django-users have asked about deleting an object while preserving related objects, preferably by setting their foreign key fields to NULL, but AFAIK we don't expose that functionality in any way.

So, a proposed enhancement to model definitions. `ForeignKeyField` should take two extra optional arguments:

`on_delete` -- value is one of: `cascade`, `restrict`, `set_null`, `set_default`. If it's `set_default`, a default value must be supplied. I'm thinking we can get by with just `restrict` and not also `no_action`, but open to arguments about it.

`on_update` -- same as above.

These constraints should be output in the SQL for the databases which support them, but either way they should always be respected by Django."	defect	closed	Core (Other)		normal	wontfix		petertripp@… gabor@… Gonzalo Saavedra	Design decision needed	0	0	0	0	0	0
