Код: Выделить всё
@app.route('/recipe/', methods=['GET'])
def get(id):
recipe = get_recipe_from_db(id)
return render_template('recipe.html', recipe=recipe)
Код: Выделить всё
@app.route('/recipe/', methods=['GET'])
def get(id):
recipe = get_recipe_from_db(id)
return redirect(url_for('get_with_title', id=id, title=urlify(recipe.title)))
@app.route('/recipe//', methods=['GET'])
def get_with_title(id, title=None):
recipe = get_recipe_from_db(id)
return render_template('recipe.html', recipe=recipe)
Есть ли лучший способ сделать это? Большие содержащие несколько полей, и я не хочу передавать его по сети неоправданно.
Подробнее здесь: https://stackoverflow.com/questions/708 ... -with-data