Пример #1
0
def catalog():
    categories = db_categories(session)
    latest_items = db_latest_items(session)
    return render_template('catalog.html',
                           categories=categories,
                           latest_items=latest_items,
                           is_logged_in=is_already_logged_in(login_session))
Пример #2
0
def catalog_as_json():
    categories = db_categories(session)
    categories = [c.serialize for c in categories]

    latest_items = db_latest_items(session)
    latest_items = [i.serialize for i in latest_items]

    return json.dumps({ 'categories': categories, 'latest_items': latest_items })
Пример #3
0
def catalog_as_json():
    categories = db_categories(session)
    categories = [c.serialize for c in categories]

    latest_items = db_latest_items(session)
    latest_items = [i.serialize for i in latest_items]

    return json.dumps({'categories': categories, 'latest_items': latest_items})
Пример #4
0
def catalog():
    categories = db_categories(session)
    latest_items = db_latest_items(session)
    return render_template('catalog.html', categories=categories, latest_items=latest_items,
                           is_logged_in=is_already_logged_in(login_session))