Hello all,
I have an existing app with the following model
class Contact(models.Model):
lastname = models.CharField(max_length=200)
firstname = models.CharField(max_length=200)
...
class Journalist(Contact):
pass
I have a Contact
in my database and I would like that it becomes a Journalist
.
In raw sql, it seems as simple as insert into app_journalist values (25624);
. In this example 25624 is the id of the existing contact. It seems to work ok and the django app seems happy.
However, I would like to make the same thing with the django ORM. I have tried several thinks like forcing the journalist id (Journalist(id=25624)
) but it creates a new contact rather than linking to the existing one.
Is it possible do to that with the Django ORM? How?
Thanks in advance for your help