def index(): """ This endpoint shows all available stores from the database :return: Store index for the application """ stores = Store.all() return render_template('stores/store_index.html', stores=stores)
def delete_store(store_id): store = Store.get_by_id(store_id) print(store_id) print(store) for a in store: a.remove_from_mongo() store = Store.all() return render_template('stores/store_index.html', stores=store)
def create_store(): 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(name, url_prefix, tag_name, query).persist() stores = Store.all() return render_template('/stores/index.html', stores=stores) else: return render_template('/stores/new_store.html')
def new_store(): if request.method == 'POST': name = request.form['name'] url_prefix = request.form['url_prefix'] tag_name = request.form['tag_name'] query_json = request.form['query'] query = json.loads(query_json) Store(name, url_prefix, tag_name, query).save_to_mongo() stores = Store.all() return render_template("stores/index.html", stores=stores) return render_template("stores/new_store.html")
def index(): stores = Store.all() return render_template('stores/index.html', stores=stores)
def index(): stores = Store.all() return render_template("store_index.html", stores=stores)
def index(): stores_present = Store.all() print("RKS: STORE INDEX ALL done") return render_template('stores/store_index.html', stores=stores_present)
def index(): stores = Store.all() # loading all items from mongodb to display on page return render_template('stores/index.html', stores=stores)
def index(): stores = Store.all() # get all stores return render_template( 'stores/store_index.html', stores=stores) # give the stores variable inside the template
def delete_store(store_id): store = Store.get_by_id(store_id) store.remove_from_mongo() stores = Store.all() return render_template("stores/index.html", stores=stores)
def all_stores(): stores = Store.all() return render_template('stores/all_stores.html', stores=stores)