Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
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')
Beispiel #4
0
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")
Beispiel #5
0
def index():
    stores = Store.all()
    return render_template('stores/index.html', stores=stores)
Beispiel #6
0
def index():
    stores = Store.all()
    return render_template("store_index.html", stores=stores)
Beispiel #7
0
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)
Beispiel #9
0
def index():
    stores = Store.all()  # get all stores
    return render_template(
        'stores/store_index.html',
        stores=stores)  # give the stores variable inside the template
Beispiel #10
0
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)
Beispiel #11
0
def all_stores():
    stores = Store.all()
    return render_template('stores/all_stores.html', stores=stores)