コード例 #1
0
def delete_sensor_threshold():
    page = 1
    # 接收页码
    if request.values.get('page'):
        page = int(request.values.get('page'))
    id = request.values.get('id')
    obj = Sensor_threshold.query.filter(Sensor_threshold.id == id).first()
    delete(obj)
    sensor_thresholds = Sensor_threshold.query.paginate(page=page, per_page=10)
    return toJson(sensor_thresholds)
コード例 #2
0
def delete_pond():
    page = 1
    # 接收页码
    if request.values.get('page'):
        page = int(request.values.get('page'))
    pond_id = request.values.get('id')
    obj = Pond.query.filter(Pond.id == pond_id).first()
    delete(obj)
    ponds = Pond.query.paginate(page=page, per_page=10)
    return toJson(ponds)
コード例 #3
0
def delete_item(cid, iid):
    item = model.category_item(cid, iid)[1]
    if item is not None:
        if not is_user() and item.user_id != login_session['user_id']:
            return redirect(url_for('login'))
        model.delete(item)
        flash("Item deleted successfully")
    else:
        flash("Oops some thing went wrong!")
    return redirect(url_for("home"))
コード例 #4
0
def delete_alarm():
    page = 1
    # 接收页码
    if request.values.get('page'):
        page = int(request.values.get('page'))
    id = request.values.get('id')
    obj = Alarm.query.filter(Alarm.id == id).first()
    delete(obj)
    alarms = Alarm.query.paginate(page=page, per_page=10)
    return toJson(alarms)
コード例 #5
0
ファイル: user.py プロジェクト: sppkisa/fish
def delete_user():
    page = 1
    # 接收页码
    if request.values.get('page'):
        page = int(request.values.get('page'))
    user_id = request.values.get('id')
    obj = User.query.filter(User.user_id == user_id).first()
    delete(obj)
    users = User.query.paginate(page=page, per_page=10)
    return toJson(users)