#14368: Reverse relation attribute for OneToOneField fails when set to None
---------------------------------------------------+------------------------
          Reporter:  gsakkis                       |         Owner:  nobody     
       
            Status:  new                           |     Milestone:  1.3        
       
         Component:  Database layer (models, ORM)  |       Version:  1.2        
       
        Resolution:                                |      Keywords:  
OneToOneField, bug
             Stage:  Accepted                      |     Has_patch:  0          
       
        Needs_docs:  0                             |   Needs_tests:  0          
       
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by gsakkis):

 I'm baffled, your comment doesn't make any sense.

 > I disagree. Do you expect a message when you do: instance.queryset_set =
 SomeQueryset.objects.all()?

 Even if setting to None is not allowed, are you seriously against an error
 message that explains why, when ten lines above it does exactly that for
 non-nullable fields? And I have no idea what the `instance.queryset_set =
 SomeQueryset.objects.all()` analogy is supposed to mean; it's perfectly
 valid code that does work, so I don't expect any message.

 > You're explicitly defining an accessor and expecting the ORM to know
 what you mean. In your example, soul isn't a field on Bob so stop treating
 it like it is one. person is a field on Soul.

 So `bob.soul = None` is "treating it like a field" but `bob.soul =
 Soul.objects.create()` doesn't ?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14368#comment:6>
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-upda...@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