Re: a question about model inheritance after qs-rf

2008-05-01 Thread medhat
You are right, and my sample function above "extend" also works. The problem is that I had a read-only property in my child model that had the same name as one of the fields in the parent model. I had not noticed that until I dug deeper to investigate the issue :-( thanks for your help. --

Re: a question about model inheritance after qs-rf

2008-05-01 Thread AmanKow
I did the following, it works fine: from django.db import models class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) def __unicode__(self): return self.name # you can call this on any model object def

Re: a question about model inheritance after qs-rf

2008-05-01 Thread AmanKow
Whoops... get should be filter existing_ct_as_dict=ContentType.objects.filter(pk=ct_pk).values()[0] On Apr 30, 9:04 am, AmanKow <[EMAIL PROTECTED]> wrote: > Assuming ACT is your class name: > > ct = #... get the content type instance to extend here, or obtain the > pk in whatever way >

Re: a question about model inheritance after qs-rf

2008-04-30 Thread medhat
Trying to use this idea, I created the following function: def extend(parent_class, parent_id, child_class, **kwargs): p = parent_class.objects.filter(pk=parent_id).values()[0] p.update(kwargs) c = child_class(**p) return c but that still does not work. It throws an

Re: a question about model inheritance after qs-rf

2008-04-30 Thread AmanKow
Hmmm... this seems to be a common issue... extending already existing records Would be nice if there were a way to create the child, specify the pk and do a "save child only" On Apr 30, 9:04 am, AmanKow <[EMAIL PROTECTED]> wrote: > Assuming ACT is your class name: > > ct = #... get the content

a question about model inheritance after qs-rf

2008-04-29 Thread medhat
Hi, QS-rf in general and model inheritance in particular are really cool. I have been waiting for them for a long time, thanks :-) I am trying now to use them. And one question I have is the following: for multi-table inheritance, (using the example from the documentation,) let's say that we