def create_store(): if request.method == 'POST': name = request.form['name'] url_prefix = request.form['url_prefix'] tag_name = request.form['tag_name'] query = request.form['query'] review = request.form['review'] Store(name, url_prefix, tag_name, query, review).save_to_db() return render_template('stores/store_index.jinja2', stores=Store.all()) # What happens if it's a GET request return render_template("stores/new_store.jinja2")
def create_alert(): if request.method == 'POST': name = request.form['name'] url = request.form['url'] store_id = request.form.get('store') price_limit = float(request.form['price_limit']) item = Item(name, url, store_id) item.save_to_mongo() alert = Alert(session['email'], price_limit, item._id) alert.load_item_price() return redirect(url_for('users.user_alerts')) stores = Store.all() return render_template("alerts/create_alert.html", stores=stores)
def index(): stores = Store.all() return render_template('stores/store_index.html', stores=stores)
def index(): print(session['email']) stores = Store.all() return render_template('stores/store_index.jinja2', stores=stores)
def delete_store(store_name): Store.get_by_name(store_name).delete() return render_template('stores/store_index.jinja2', stores=Store.all())
def index(): stores = Store.all() return render_template("stores/store_index.jinja2", stores=stores)
def index(): stores = Store.all() return render_template('stores/store_list.jinja2', stores=stores)
def index(): stores = Store.all() return render_template('stores/store_index.jinja2', stores=stores)
def index(): stores = Store.all() return render_template('/stores/store_index.html', stores=stores)
def index(): stores = Store.all() newstores = sorted(stores, key=lambda store: store.name) return render_template('stores/store_index.jinja2', stores=newstores)