Skip to content

Instantly share code, notes, and snippets.

@anis016
Created August 31, 2016 22:43
Show Gist options
  • Save anis016/b7b658344b0f177075636e8cf8472593 to your computer and use it in GitHub Desktop.
Save anis016/b7b658344b0f177075636e8cf8472593 to your computer and use it in GitHub Desktop.
Store models [view.py]
@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