I am new to Django and I am trying to implement this Relationship in Django
Person has a Car Car can be tested for problems A car should be tested for a select set of criterias
So I implement it as
class Person(model.Model): name = models.CharField(max_length=60) license = models.CharField(max_length=80) class Car(models.Model): name = models.CharField() owner = models.ForeignKey('Person') isDiesel = models.BooleanField()
I am trying to import the fields of car into test. Is there anyway way to do it? I am trying to replicate this SQL statement
SELECT test FROM table WHERE OWNER IS x (object instance) AND CAR IS isDiesel
Thanks in advance.