#10227: OneToOne fields with null=True raise DoesNotExist exception on related
model
---------------------------------------------------+------------------------
          Reporter:  rvdrijst                      |         Owner:  nobody     
                    
            Status:  new                           |     Milestone:             
                    
         Component:  Database layer (models, ORM)  |       Version:  1.0        
                    
        Resolution:                                |      Keywords:  onetoone 
related expection null
             Stage:  Design decision needed        |     Has_patch:  1          
                    
        Needs_docs:  0                             |   Needs_tests:  0          
                    
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by Jonas):

 * cc: dja...@vonposer.de (added)

Comment:

 Replying to [comment:7 olau]:
 > So I think we need to model it with a separate parameter, e.g.
 related_null=True. That would also be backwards-compatible.

 This seems an elegant solution. I would really like to have this
 functionality, as it makes extending the User model much easier. For
 instance, we have a Member model with a OneToOneField to User. Since I
 can't add a property to User (except by monkeypatching it), I have to wrap
 every access to request.user.member with a try/except block.

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