示例#1
0
文件: site.py 项目: jmacj/xlibsys
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)
示例#2
0
文件: api.py 项目: jmacj/xlibsys
def get_inventory():
    return jsonify([row for row in Inventory.select(Inventory).dicts()])