#14163: Setting pk should set the related fields also in the base chain.
-----------------------------------------------------+----------------------
 Reporter:  akaariai                                 |       Owner:  nobody    
   Status:  new                                      |   Milestone:            
Component:  Database layer (models, ORM)             |     Version:  1.2       
 Keywords:  Inheritance, parent_link, OneToOneField  |       Stage:  Unreviewed
Has_patch:  0                                        |  
-----------------------------------------------------+----------------------
 Consider two models:

 {{{
 class A(models.Model):
     pass

 class B(A):
     a = models.OneToOneField(A, parent_link=True, primary_key=True)
 }}}

 creating an b instance and setting its pk should also set the a.id:
 {{{
 >>> b = B(pk=1)
 >>> b.pk
 1
 >>> b.a_id
 1
 >>> b.id
 1
 }}}

 At the moment we will get:
 {{{
 >>> b.id is None
 True
 }}}

 It would be even better if setting b.id would also set b.a_id, but that is
 harder to do, and maybe it isn't that important.

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