Doubt in SQL conversion to Django ORM

0

Hello

I am studying starting in Django ORM and would like help to convert the SQL below as I am not able to perform the necessary joins. Following:

SELECT P.nome, T.nome FROM 
professor as D 
INNER JOIN pessoa_fisica AS PF ON (D.pessoa_fisica_id = PF.pessoa_id) 
INNER JOIN pessoa AS P ON (PF.pessoa_id = P.id)
INNER JOIN funcionario AS F ON(F.pessoafisica_id = PF.pessoa_ptr_id) 
INNER JOIN ocupacao AS S ON(S.funcionario_id = F.pessoafisica_id)
INNER JOIN Titulo as T on (S.titulacao_id = T.id) ORDER BY p.nome 

What is the best way to do this in Django ORM?

Thank you!

    
asked by anonymous 16.11.2017 / 15:08

0 answers