﻿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
12166	Instance.delete() cascade deletes related objects with null=True	oremj	nobody	"Server model relation:
  {{{ server_model = models.ForeignKey('ServerModel', blank=True, null=True) }}}

{{{
a = System.objects.all()[0]
b = ServerModels.objects.all()[0]

b.delete()
}}}
Both b and a are deleted.

db.connection.queries:
{{{
 {'sql': u'SELECT `systems`.`id`, `systems`.`hostname`, `systems`.`serial`, `systems`.`operating_system_id`, `systems`.`server_model_id`, `systems`.`created_on`, `systems`.`updated_on`, `systems`.`oob_ip`, `systems`.`asset_tag`, `systems`.`notes`, `systems`.`licenses`, `systems`.`allocation_id`, `systems`.`system_rack_id`, `systems`.`rack_order`, `systems`.`switch_ports`, `systems`.`patch_panel_port`, `systems`.`oob_switch_port`, `systems`.`purchase_date`, `systems`.`purchase_price`, `systems`.`system_status_id`, `systems`.`change_password`, `systems`.`ram` FROM `systems` WHERE `systems`.`server_model_id` = 221 ',
 {'sql': u'UPDATE `systems` SET `server_model_id` = NULL WHERE `id` IN (1333)',
 {'sql': u'DELETE FROM `systems` WHERE `id` IN (1333)'},
 {'sql': u'DELETE FROM `server_models` WHERE `id` IN (221)'}]

}}}

I'm not seeing this problem on 1.1, but I am seeing it on 1.1.1 and later.
"		closed	Uncategorized	1.1		duplicate			Unreviewed	0	0	0	0	0	0
