コード例 #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)
コード例 #2
0
ファイル: storees.py プロジェクト: mingrogue/Pricing-Servce
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)
コード例 #3
0
ファイル: stores.py プロジェクト: farnsies/pricing-service
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')
コード例 #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")
コード例 #5
0
ファイル: stores.py プロジェクト: CruzST/price-watch
def index():
    stores = Store.all()
    return render_template('stores/index.html', stores=stores)
コード例 #6
0
def index():
    stores = Store.all()
    return render_template("store_index.html", stores=stores)
コード例 #7
0
ファイル: stores_bp.py プロジェクト: rksingh61/item-price
def index():
    stores_present = Store.all()
    print("RKS: STORE INDEX ALL done")
    return render_template('stores/store_index.html', stores=stores_present)
コード例 #8
0
def index():
    stores = Store.all()  # loading all items from mongodb to display on page
    return render_template('stores/index.html', stores=stores)
コード例 #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
コード例 #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)
コード例 #11
0
def all_stores():
    stores = Store.all()
    return render_template('stores/all_stores.html', stores=stores)