#11811: No error raised on update(foreignkey=unsavedobject) on nullable fk
------------------------------------------+---------------------------------
 Reporter:  Afief                         |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.1       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 Found this while coding at 2AM:
 When there is a field that can be NULL, and you do something like this:
 obj1=Obj1(...)
 obj2=Obj2.objects.all().update(foreignobj=obj1)

 django will assign the fields to NULL.

 I'm not sure if this behaviour is made to be so by design, but it seems to
 me that if someone passes an unsaved object instead of None they made a
 mistake and django should raise an exception.

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