Skip to content

Instantly share code, notes, and snippets.

@Porter97
Last active March 3, 2020 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/02f606e11995bd8c7f31ee6082ac836a to your computer and use it in GitHub Desktop.
Save Porter97/02f606e11995bd8c7f31ee6082ac836a to your computer and use it in GitHub Desktop.
from flask import render_template, flash, redirect, url_for, abort, request, current_app
#...
@main.route('/users')
def users():
page = request.args.get('page')
pagination = User.query.filter(User.confirmed == True).filter(User.id != current_user.id).paginate(
page,
per_page=current_app.config['OFFBRAND_RESULTS_PER_PAGE'],
error_out=False)
users = pagination.items
return render_template('users.html', users=users, pagination=pagination)
#...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment