I've got:
class User(models.Model):
name = models.CharField()
class Worker(User):
role = models.CharField()
I've imported all of Users from a legacy database. And I can obviously make:
bob = User.objects.get(name='bob')
which returns bob
instance.
But now, I need to create a Worker instance that inherits from bob
? I first thought of this:
MyWorker = Worker.objects.create(
pk = bob.pk,
role = 'chief')
which returns a new Worker instance but not correlated to Bob user as I wanted. How could I create this Worker instance based on bob
instance then?