views:

58

answers:

0

I want to generate a queryset to find mismatches. As an example

class Vehicle(models.Model):
    car = models.CharField(max_length=100)
    model= models.CharField(max_length=100)
    passengers = models.IntegerField()

i want to generate a query where i can find cars erroneously listed with two different models.

something along the lines of a query to find that if a car = Wrangler, model = Jeep to find instances of car = Wrangler, model is not Jeep.

Is this possible to do within the ORM, or do i need to use raw SQL? Someone in #django suggested a subquery, but I am not familiar with how to do this