def delete_req(id): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(EnvironmentRequest).filter( EnvironmentRequest.id == id) req = qry.first() if req: form = EnvironmentRequestForm(formdata=request.form, obj=req) if request.method == 'GET': form.keep_data.data = req.keep_data form.keep_ld.data = req.keep_ld form.backup_db.data = req.backup_db if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(req) db_session.commit() flash('Request deleted successfully!') return redirect('/') return render_template('delete_request.html', form=form) else: return 'Error deleting #{id}'.format(id=id)
def delete(id): qry = db_session.query(Album).filter(Album.id==id) album = qry.first() if album: form = AlbumForm(formdata=request.form, obj=album) if request.method == 'DELETE' and form.validate(): db_session.delete(album) db_session.commit()
def delete(): courseNum = request.form.get('course') assignmentName = request.form.get('assignmentName') deleteAssignment = db_session.query(Assignment).filter_by( name=assignmentName, class_id=courseNum).first() db_session.delete(deleteAssignment) db_session.commit() return redirect(url_for('search', courseNum=courseNum))
def del_spe(id): qry = db_session.query(Spend).filter(Spend.id==id) spend = qry.first() db_session.delete(spend) db_session.commit() flash('Spend deleted successfully!') return redirect('/spe')
def del_res(id): qry = db_session.query(Reservation).filter(Reservation.id==id) reservation = qry.first() db_session.delete(reservation) db_session.commit() flash('Reservation deleted successfully!') return redirect('/res')
def holiday_del(del_date): print('holiday del') qry = db_session.query(Holiday).filter(Holiday.c_acdcode == '0202').filter( Holiday.c_date == del_date) hday = qry.first() db_session.delete(hday) db_session.commit() print('Holiday delete successfully!') return redirect('/holiday')
def delete(id): qry = db_session.query(Article_Info).filter(Article_Info.id == id) article_info = qry.first() if article_info: form = ArticleForm(formdata=request.form, obj=article_info) if request.method == 'POST' and form.validate(): db_session.delete(article_info) db_session.commit() flash('Article deleted successfully!') return redirect('/') return render_template('delete_article.html', form=form) else: return 'Error deleting #{id}'.format(id=id)
def delete(id): qry = db_session.query(Userdata).filter(Userdata.user_id == id) userdata = qry.first() if userdata: form = EditForm(formdata=request.form, obj=userdata) if request.method == 'POST' and form.validate(): db_session.delete(userdata) db_session.commit() flash('User deleted successfully!') return redirect('/') return render_template('delete_user.html', form=form) else: return 'Error deleting #{id}'.format(id=id)
def delete_details(order, form): tablet = Tablets() id = int(form.orderid.data) qry = db_session.query(Orders).filter(Orders.orderId == id) order = qry.first() if order: tid = order.productId qry = db_session.query(Tablets).filter(Tablets.tabletId == tid) tablet = qry.first() tablet.tabletquantity = tablet.tabletquantity + order.quantity db_session.delete(order) db_session.commit() flash('your order is deleted successfully!') else: flash('orderid does not exsit deleting order is unsuccessfully!')
def delete(id): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(Album).filter(Album.id == id) album = qry.first() if album: form = AlbumForm(formdata=request.form, obj=album) if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(album) db_session.commit() flash('Album deleted successfully!') return redirect('/') return render_template('delete_album.html', form=form) else: return 'Error deleting #{id}'.format(id=id)
def delete(id): #direct deletion form the order details table qry = db_session.query(Orders).filter(Orders.orderId == id) order = qry.first() tid = order.productId qry = db_session.query(Tablets).filter(Tablets.tabletId == tid) tablet = qry.first() if order: tablet.tabletquantity = tablet.tabletquantity + order.quantity # delete the item from the database db_session.delete(order) db_session.commit() flash('your order is deleted successfully!') return redirect('/') else: return 'Error deleting #{id}'.format(id=order.orderId)
def delete(id): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(Biography).filter(Biography.id == id) biography = qry.first() if biography: form = BiographyForm(formdata=request.form, obj=biography) if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(biography) db_session.commit() flash('Book deleted successfully!') return redirect('/') return render_template('delete_book.html', form=form) else: return 'Error deleting #{id}'.format(id=id)
def delete(item_number): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(Price).filter(Price.item_number == item_number) price = qry.first() if price: form = PriceForm(formdata=request.form, obj=price) if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(price) db_session.commit() flash('Price deleted successfully!') return redirect('/') return render_template('delete_album.html', form=form) else: return 'Error deleting #{item_number}'.format(item_number=item_number)
def delete(id): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(Store).filter( Store.id==id) store = qry.first() if store: form = StoreForm(formdata=request.form, obj=store) if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(store) db_session.commit() flash('Store deleted successfully!') return redirect('/') return render_template('delete_store.html', form=form) else: return 'Error deleting #{id}'.format(id=id)
def delete(id): """ Delete the item in the database """ qry = db_session.query(Bin).filter(Bin.id == id) bin = qry.first() delete = Delete(qry) delete.border = True if bin: form = ToolForm(formdata=request.form, obj=bin) if request.method == 'POST' and form.validate(): # delete the item from the databse db_session.delete(bin) db_session.commit() flash('Tool listing deleted successfully.') return redirect('/') return render_template('delete_tool.html', table=delete) else: return 'Error deleting #{id}'.format(id=id)
def delete(id): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(Song).filter(Song.id == id) song = qry.first() if song: form = SongForm(formdata=request.form, obj=song) if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(song) db_session.commit() flash( 'Song deleted successfully!' ) #this is so sick oh my gosh -caroline (p.s. omg i want it where is it from) return redirect('/') return render_template('delete_album.html', form=form) #song, not album else: return 'Error deleting #{id}'.format(id=id)
def attachmentdelete(id): qry = db_session.query(Attachments).filter(Attachments.id == id) attachments = qry.first() db_session.delete(attachments) db_session.commit() return redirect('/attachmentlist')
def floorplandelete(id): qry = db_session.query(Floorplans).filter(Floorplans.id == id) floorplan = qry.first() db_session.delete(floorplan) db_session.commit() return redirect('/floorplanlist')
def folderdelete(id): qry = db_session.query(Folders).filter(Folders.id == id) folders = qry.first() db_session.delete(folders) db_session.commit() return redirect('/folderlist')
def delete_permanent(self): db_session.delete(self) db_session.commit()
def projectdelete(id): qry = db_session.query(Projects).filter(Projects.id == id) projects = qry.first() db_session.delete(projects) db_session.commit() return redirect('/projectlist')
def sheetdelete(id): qry = db_session.query(Sheets).filter(Sheets.id == id) sheets = qry.first() db_session.delete(sheets) db_session.commit() return redirect('/sheetlist')
def plano_delete(): id = request.args.get('id', None) qry = db_session.query(plano).filter(plano.id == int(id)) db_session.delete(qry.first()) db_session.commit() return redirect('/plano_list')