#12166: Instance.delete() cascade deletes related objects with null=True
---------------------------+------------------------------------------------
 Reporter:  oremj          |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.1       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 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.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12166>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to