title: Reverse lookup of foreign key in python django
body: <p>I have 2 tables Dept and Employee</p>
  
  <pre><code>Dept has 2 columns ID and Name
  Employees has 3 columns ID, Dept_ID, Name
  </code></pre>
  
  <p>Now given a emloyee name "XYZ" I have to retrieve all the department names having an employee with name "XYZ" </p>
  
  <p>I know their is a work around for this by first retrieving all dept_id <code>having name == "XYZ"</code> from Employee table and then make another query for retrieving names of departments from Dept Table.</p>
  
  <p>Is their a way to retrieve the records in a single query.</p>