On Thu, Jun 18, 2009 at 11:21 AM, Luc Saffre <luc.saf...@gmx.net> wrote:
> > Okay, when I add an explicit parent link in my example: > > contact = models.OneToOneField(contacts.Contact,parent_link=True) > > then the TypeError disappears. But still I would now expect that the > following works: > > >>> c = Customer(contact=luc) > >>> c.save() > >>> c.last_name > Saffre > > But it fails, saying: > > Failed example: > c.last_name > > Expected: > Saffre > Got: > '' > > It looks as if Django doesn't "copy" the values of the existing Contact > into the Customer. The last_name field was inherited (it didn't say > "AttributeError: 'Customer' object has no attribute 'last_name'") but it > is empty. > > Note that I'm using Django development version, revision 11066... > > I guess that this is a bug and that it has to do with ticket #7623 > (http://code.djangoproject.com/ticket/7623). > > Thus cc to django-developers and a new very short example showing the > problem. (Should I wait for feedback from developers before opening a > new ticket?) > The ticket you reference states that it is impossible, with multi-table inheritance, to create a new child instance that inherits from an already-existing parent instance. That appears to be exactly what you are trying to do in your example, so I don't see why it would require a separate ticket. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---