python - Django Queryset Filter (Maybe Needs a Subquery) -
I want to generate a query to find mismatches. As an example
class vehicles (models.Model): car = model. Kharefild (max_length = 100) model = Model. Kharifild (max_long = 100) travelers = models.IntergrillField ()
I want to generate a query where I am with two different models You can get a listed car incorrectly.
On the lines of a question, to find out that car = Wrangler, Model = to find instances of the Jeep car = Wrangler, the model is not Jeep.
Is it possible to do within ORM, or do I need to use raw SQL? #django has suggested a subquery, but I am not familiar with how to do this
Sample output will be just a queryset of the incorrect matching vehicles (for example Car = wrangler, model = Ford exists for an object but car = wrangler, model = jeep for another object). I was thinking about not having an input which was just able to find mismatch. Does it still make sense?
If I think you need a model + the car is unique together, then you're repetitive Need to find the record:
import repetitve_cars_list = vehicle.obages Price ('car') Anotate (count_car = calculation ('car')) .filter (co unt_car__gt = 1)
This will give you car
which is more than one model
Comments
Post a Comment