Created
August 31, 2016 22:43
-
-
Save anis016/b7b658344b0f177075636e8cf8472593 to your computer and use it in GitHub Desktop.
Store models [view.py]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@store_blueprint.route('/edit/<string:store_id>', methods=['POST', 'GET']) | |
def edit_store(store_id): | |
if request.method == 'POST': | |
name = request.form['name'] | |
url_prefix = request.form['url_prefix'] | |
tag_name = request.form['tag_name'] | |
query = json.loads(request.form['query']) | |
store = Store(name, url_prefix, tag_name, query, store_id) | |
store.update_db(store_id) | |
return redirect(url_for('stores.index')) | |
store = Store.find_by_id(store_id) | |
return render_template('stores/edit_store.html', store=store) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment