#9982: Inconsistent behavior on model save depending on whether OneToOneField 
is a
primary key
---------------------------------------------------+------------------------
          Reporter:  [email protected]          |         Owner:  
mtredinnick                             
            Status:  assigned                      |     Milestone:  post-1.0   
                             
         Component:  Database layer (models, ORM)  |       Version:  1.0        
                             
        Resolution:                                |      Keywords:  
OneToOneField primary_key IntegrityError
             Stage:  Unreviewed                    |     Has_patch:  0          
                             
        Needs_docs:  0                             |   Needs_tests:  0          
                             
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by mtredinnick):

  * owner:  nobody => mtredinnick
  * needs_better_patch:  => 0
  * status:  new => assigned
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 The second case shouldn't work either. I'll have to check whether it's
 really doing something sensible there (as opposed to just not raising an
 error). It may be because of something in place for model inheritance that
 it's working; I seem to recall we added an admin-related workaround that
 was a bit of a hack. In which case, it'll just need documentation.

 Django cannot read your mind and does not automatically save things. So
 you do need to save something before using it as a reference. The first
 case is consistent and you should always save before using something as a
 related instance.

 Leaving open until I understand and document (at a minimum) what's
 happening.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9982#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