def dropPanel(): """detect the table which is to be inserted""" table = request.form['table'] sql = SQL_Server() # detect if the table is in db if not sql.tableDetect(table): # exceptions.BadRequestKeyError here return redirect('/developer') SF = sql.dropTable(table) return render_template('developer_drop.html', table=table, SF=SF)
def selectPanel(): """detect the table which is to be selected""" global table table = request.form['table'] sql = SQL_Server() # detect if the table is in db if not sql.tableDetect(table): # exceptions.BadRequestKeyError here return redirect('/developer') attributeList = sql.getAttributeListOfTable(table) return render_template('developer_select.html', table=table, attributeList=attributeList, attributeLen=len(attributeList))
def userInsertPanel(): """detect the table which is to be inserted""" global table table = request.form['table'] sql = SQL_Server() # detect if the table is in db if not sql.tableDetect(table): # exceptions.BadRequestKeyError here return redirect('/developer') attribute = '*' results = sql.selectFromTable(table, attribute) attributeList = sql.getAttributeListOfTable(table) if len(results) != 0: col = len(results[0]) else: col = 0 return render_template('user_insert.html', table=table, attributeList=attributeList, results=results, attribute=attribute, row=len(results), col=col, attributeLen=len(attributeList))