当前位置: 首页>>代码示例>>Python>>正文


Python Alert.load_item_price方法代码示例

本文整理汇总了Python中src.models.alerts.alert.Alert.load_item_price方法的典型用法代码示例。如果您正苦于以下问题:Python Alert.load_item_price方法的具体用法?Python Alert.load_item_price怎么用?Python Alert.load_item_price使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在src.models.alerts.alert.Alert的用法示例。


在下文中一共展示了Alert.load_item_price方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_alert

# 需要导入模块: from src.models.alerts.alert import Alert [as 别名]
# 或者: from src.models.alerts.alert.Alert import load_item_price [as 别名]
def create_alert():
    if request.method == 'POST':
        name = request.form['name']
        url = request.form['url']
        price_limit = float(request.form['price'])
        item = Item(name, url)
        item.save_to_mongo()
        alert = Alert(session['email'], price_limit, item._id)
        alert.load_item_price()

    return render_template('alerts/create_alert.html')
开发者ID:jslvtr,项目名称:alert-my-wishlist,代码行数:13,代码来源:views.py

示例2: create_alert

# 需要导入模块: from src.models.alerts.alert import Alert [as 别名]
# 或者: from src.models.alerts.alert.Alert import load_item_price [as 别名]
def create_alert():
    if request.method == 'POST':
        name = request.form['name']
        url = request.form['url']
        price_limit = float(request.form['price_limit'])

        item = Item(name, url)
        item.save_to_mongo()

        alert = Alert(session['email'], price_limit, item._id)
        alert.load_item_price()  # This already saves to MongoDB

    # What happens if it's a GET request
    return render_template("alerts/new_alert.jinja2")  # Send the user an error if their login was invalid
开发者ID:AlinaKay,项目名称:price-of-chair,代码行数:16,代码来源:views.py

示例3: create_alert

# 需要导入模块: from src.models.alerts.alert import Alert [as 别名]
# 或者: from src.models.alerts.alert.Alert import load_item_price [as 别名]
def create_alert():
    if request.method == 'POST':
        name = request.form['name']
        url = request.form['url']
        price_limit = float(request.form['price_limit'])

        # el constructor de Alert busca el item por id asi que el item tiene que existir antes de ccrear la alert

        item = Item(name, url)
        item.save_to_mongo()

        alert = Alert(session['email'], price_limit, item._id)
        alert.load_item_price() #ya salva la alert a mongo

    return render_template('alerts/new_alert.html')
开发者ID:FMGordillo,项目名称:price_of_chair_web,代码行数:17,代码来源:views.py

示例4: create_alert

# 需要导入模块: from src.models.alerts.alert import Alert [as 别名]
# 或者: from src.models.alerts.alert.Alert import load_item_price [as 别名]
def create_alert():
    if request.method == 'POST':
        name = request.form['name']
        url = request.form['url']
        price_limit = float(request.form['price-limit'])

        # create an item first
        item = Item(name, url)
        item.save_to_mongo()

        # now create an alert to this item
        alert = Alert(session['email'], price_limit, item._id)
        alert.load_item_price() # this already saves to MongoDB

        # return redirect(url_for('user_alerts'))

    # What happens if it's a GET request
    return render_template('/alerts/new_alert.html')
开发者ID:MaynardTool,项目名称:pricing-service,代码行数:20,代码来源:views.py


注:本文中的src.models.alerts.alert.Alert.load_item_price方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。