title: SQLAlchemy Can't Find Column when adding ForeignKey to another table
body: <p>I have been fighting this error for a few days now in a variety of configurations.
  I tried adding Relationship lines under each of the ForeignKeys with no luck.
  I also swapped my queries from using the declarative_base style calls to SQL queries.
  The error only appears once I add the second ForeignKey to Task. (I originally had several foreign keys in Task and Project but pared things down until it worked and tried slowly adding things back. Adding the second ForeignKey did it no matter which table it was added to.)</p>
  
  <p>My current Flask method is:</p>
  
  <pre><code>@app.route('/project/&lt;int:project_id&gt;/')
      def showProject(project_id):
          project = session.query(Project).from_statement(text("SELECT * FROM project WHERE project.id = project_id ORDER BY project.projnum DESC"))
          tasks = session.query(Task).filter_by(project_id = project_id).all()
          return render_template('project.html', project = project, tasks = tasks)
  </code></pre>
  
  <p>And I get a "no such column" error:</p>
  
  <p><code>OperationalError: (sqlite3.OperationalError) no such column: task.project_id [SQL: u'SELECT task.id AS task_id, task.name AS task_name, task.description AS task_description, task.assigned_id AS task_assigned_id, task.project_id AS task_project_id, task.due AS task_due \nFROM task \nWHERE task.project_id = ?'] [parameters: (2,)]</code>    </p>
  
  <p>This is the setup file for my database:</p>
  
  <pre><code>import os
  import sys
  import time
  from sqlalchemy import Column, ForeignKey, Integer, String, Float
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import relationship
  from sqlalchemy import create_engine
  
  Base = declarative_base()
  
  engine = create_engine('sqlite:///gmnpm.db')
  
  class User(Base):
      __tablename__ = 'user'
  
      id = Column(Integer, primary_key=True)
      name = Column(String(250), nullable=False)
      email = Column(String(250), nullable=False)
      picture = Column(String(250))
  
  class Task(Base):
      __tablename__ = 'task'
  
      id = Column(Integer, primary_key=True)
      name = Column(String(250), nullable=False)
      description = Column(String(2000))
      assigned_id = Column(Integer, ForeignKey('user.id'))
      project_id = Column(Integer, ForeignKey('project.id'))
      due = Column(Integer, default=int(time.time()))
  
  class Project(Base):
      __tablename__ = 'project'
  
      id = Column(Integer, primary_key=True)
      name = Column(String(250), nullable=False)
      description = Column(String(1000))
      projnum = Column(Integer)
  
  Base.metadata.create_all(engine)
  </code></pre>
  
  <p>After reading a bunch of documentation and going crazy trying random things on the off chance they work, I'm grateful for any suggestions!</p>