I'm trying to map this "simple" SQL-Statement into SQL-Alchemy
select DISTINCT cv.*, ct."name"
from "CarVariants" cv,
"Cars" ca,
"CarTypes" ct
where cv."f_keyNumber" = ca."keyNumber"
and cv."carType" = ca."carType"
and cv."carType" = ct."f_carType"
and "f_keyNumber" = '12345'
and "f_carId" = 1
Something like this:
variants = self.em.CarVariants.createQuery();
variants = variants.filter_by(f_keyNumber=12345, f_carId = 1).distinct()
How do I add the "and"-relations (Cars, CarTypes) ?