class Machine(models.Model):
name= models.CharField( max_length=120)
class Meta:
abstract = True
class Car(Machine):
speed = models.IntegerField()
class Computer(Machine)
ram = models.IntegerField()
My question is, how can I understand what type is the Machine model. For instamce I know the incoming query is a children of the Machine model but I also want to know it is a Car submodel.
I am not sure if I understand your question correctly. If you are trying to find out the type of a given instance you can use the built-in
typefunction.Or if you wish to check if
an_objectis an instance ofCaryou can useisinstance.