findall with join two tables

I have a query like this




"SELECT t1.id ,t1.status,t1.patient_lastname,t1.patient_firstname FROM patients AS t1 JOIN episode AS t2 WHERE t2.id = t1.id AND t2.status='C'"




How i write this using findall ??

I have two models Patients(of table patients) and Episode(of table episode)

Did you configure the relations between these classes? You can read about it in the guide. Also I think you should use “ON t2.id = t1.id” instead of “WHERE”. “JOIN” without the “ON” part doesn’t make much sense.

thank u… i wil try and get back to you…