def all_items(): """ Return 9 last added items :return string: JSON """ items = get_items(limit=9) json = [item.serialize for item in items] return jsonify(json)
def home_page(): """ Main page :return: """ title = 'Home page' cars = [item.serialize for item in get_items(9)] return render('catalog/index.html', brands=brands, cars=cars, title=title)
def response(response_id): response = get_response(response_id) board = get_board(response.board_id) items = get_items(response.board_id) return render_template('response.html', response=response, board=board, items=items)
def items(): inventory = models.get_trash() if ('trash' in request.args) else models.get_items() if len(inventory): return {'inventory': inventory}, 200 return '', 204
def board(board_id): board = get_board(board_id) items = get_items(board_id) responses = get_responses(board_id) return render_template('board.html', board=board, items=items, responses=responses)