title: How to query a table, in sqlalchemy
body: <p>I know how to query on a model now. Suppose there is a <code>Question</code> model:</p>
  
  <pre><code>class Question(Base):
      __tablename__ = "questions"
      id=Column(...)
      user_id=Column(...)
      ...
  </code></pre>
  
  <p>Now, I can do:</p>
  
  <pre><code>question = Session.query(Question).filter_by(user_id=123).one()
  </code></pre>
  
  <p>But, now, I have a table (not a model) <code>questions</code>:</p>
  
  <pre><code>questions = Table('questions', Base.metadata,
                    Column(id, ...),
                    Column(user_id, ...),
                    ....)
  </code></pre>
  
  <p>How to query it as what I do with models?</p>
  
  <pre><code>Session.query(questions).filter_by(user_id=123).one()
  </code></pre>
  
  <p>This will report an error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;console&gt;", line 1, in &lt;module&gt;
  File "E:\Python27\lib\site-packages\sqlalchemy-0.6.3-py2.7.egg\sqlalchemy\orm\query.py", line 851, in filter_by
    for key, value in kwargs.iteritems()]
  File "E:\Python27\lib\site-packages\sqlalchemy-0.6.3-py2.7.egg\sqlalchemy\orm\util.py", line 567, in _entity_descriptor
      desc = entity.class_manager[key]
  AttributeError: 'NoneType' object has no attribute 'class_manager'
  </code></pre>
  
  <p>But:</p>
  
  <pre><code>Session.query(questions).all()
  </code></pre>
  
  <p>is OK.</p>
  
  <p>Is <code>filter_by</code> only work for models? How can I query on tables?</p>