#14043: Incorrect and/or confusing behaviour with nullable OneToOneField
---------------------------------------------------+------------------------
          Reporter:  theevilgeek                   |         Owner:  gsakkis    
                              
            Status:  assigned                      |     Milestone:             
                              
         Component:  Database layer (models, ORM)  |       Version:  SVN        
                              
        Resolution:                                |      Keywords:  
OneToOneField, cascading delete, nullable
             Stage:  Unreviewed                    |     Has_patch:  0          
                              
        Needs_docs:  0                             |   Needs_tests:  0          
                              
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by gsakkis):

  * status:  new => assigned
 * cc: gsakkis (added)
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * owner:  nobody => gsakkis
  * needs_docs:  => 0

Comment:

 Confirmed here too, it's definitely non obvious, if not outright a bug.
 Also the SQL being issued on `bob.delete()` hints that something is fishy:
 {{{
 In [11]: bob.delete()
 UPDATE `lib_soul`
 SET `person_id` = NULL
 WHERE `id` IN (4)

 DELETE
 FROM `lib_soul`
 WHERE `id` IN (4)

 DELETE
 FROM `lib_person`
 WHERE `id` IN (2)
 }}}

 Why do an update if it is going to be deleted right after ?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14043#comment:1>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to