title: Joining data from multiple tables using SQLAlchemy
body: <p>I have three tables in my database:</p>
  
  <pre><code>Links
  -----------------------
  id | student| class
  1 | 2 | 1
  2 | 1 | 1
  3 | 1 | 2
  
  Student
  -----------------------
  id | name | age
  1 | Bob | 16
  2 | Jane | 17
  
  Class
  _______________________
  id | subject
  1 | Math
  2 | Science
  </code></pre>
  
  <p>I want to be able to look at the links table to see what students are in what class and return the results from the student table per class. So, if I were looking at a page that had class information I would get all the students information that are in that class. I want to be able to use Sqlalchemy to make this query, which is what's confusing me since I can't just a straight up JOIN or something.</p>
  
  <p>I'll be passing the class information to the function in Flask, like:</p>
  
  <pre><code>@main.route('/class/&lt;class_id&gt;')
  @login_required
  def view_class(class_id):
  </code></pre>
  
  <p>Any help would be appreciated!</p>