title: Flask SQLAlchemy pagination error
body: <p>I have this code and the <code>all()</code> method and every other method works on this and I have looked all over and I could that the method <code>paginate()</code> works on <code>BaseQuery</code> which is also <code>Query</code></p>
  
  <pre><code>@app.route('/')
  @app.route('/index')
  @app.route('/blog')
  @app.route('/index/&lt;int:page&gt;')
  def index(page = 1):
      posts = db.session.query(models.Post).paginate(page, RESULTS_PER_PAGE, False)
  return render_template('index.html', title="Home", posts=posts)
  </code></pre>
  
  <p>but this gives me the error <code>AttributeError: 'Query' object has no attribute 'paginate'</code>
  I've looked everywhere and I can't find any solution to this.</p>