I have this code and the all()
method and every other method works on this and I have looked all over and I could that the method paginate()
works on BaseQuery
which is also Query
@app.route('/')
@app.route('/index')
@app.route('/blog')
@app.route('/index/<int:page>')
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)
but this gives me the error AttributeError: 'Query' object has no attribute 'paginate'
I've looked everywhere and I can't find any solution to this.