Example #1
0
def index():
    # return jsonify(session['user'])
    book_count = Inventory.select().count()
    borrowed_count = Inventory.select().where(
        Inventory.status == 'Out').count()
    user_count = User.select().count()
    return render_template('nav/index.html',
                           book_count=book_count,
                           borrowed_count=borrowed_count,
                           user_count=user_count)
Example #2
0
File: api.py Project: jmacj/xlibsys
def get_inventory():
    return jsonify([row for row in Inventory.select(Inventory).dicts()])