add data to db
This commit is contained in:
19
app.py
19
app.py
@@ -140,11 +140,6 @@ def getall():
|
||||
|
||||
return jsonify(results)
|
||||
|
||||
@app.route('/updateduplicate', methods=['GET', 'POST'])
|
||||
def updateduplicate():
|
||||
if request.method == 'POST':
|
||||
aud = request.form.get('auditory_dubl')
|
||||
|
||||
|
||||
@app.route('/vneaud', methods=['GET', 'POST'])
|
||||
def vneaud():
|
||||
@@ -200,19 +195,21 @@ def addraspved():
|
||||
|
||||
query_string = request.data.decode()
|
||||
|
||||
print(query_string)
|
||||
un_query_string = unquote(unquote(query_string)).split(',')
|
||||
|
||||
print(un_query_string)
|
||||
|
||||
|
||||
|
||||
ob = db.session.query(Oboruds).filter_by(invNumber=un_query_string[0]).first()
|
||||
ob.raspologenie=un_query_string[2]
|
||||
ob.numberved = un_query_string[1]
|
||||
|
||||
ob.numberved=un_query_string[1]
|
||||
ob.kolichestvo = un_query_string[2]
|
||||
ob.balancenumber = un_query_string[3]
|
||||
ob.raspologenie=un_query_string[4]
|
||||
|
||||
|
||||
db.session.commit()
|
||||
db.session.close()
|
||||
|
||||
|
||||
return jsonify({'success': True}, 200, {'ContentType': 'application/json'})
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ function getAllData(){
|
||||
let rasp = document.getElementById('modal_rapolog')
|
||||
|
||||
invnom.innerText = invnomertxt
|
||||
matcen.innerText = nazvanietxt.substring(0,15)
|
||||
matcen.innerText = nazvanietxt.substring(0,20)
|
||||
|
||||
if (vednumbertxt.length>0){
|
||||
vedomost.value = vednumbertxt;
|
||||
@@ -93,11 +93,11 @@ $( document ).ready(function() {
|
||||
|
||||
|
||||
|
||||
vednumber = '';
|
||||
kolvo = '';
|
||||
balancenumber = '';
|
||||
matcen = '';
|
||||
rasp = '';
|
||||
vednumber.value = '';
|
||||
kolvo.value = '';
|
||||
balancenumber.value = '';
|
||||
matcen.value = '';
|
||||
rasp.value = '';
|
||||
$('#getmodal').modal('hide')
|
||||
|
||||
|
||||
@@ -137,19 +137,19 @@ $('#modalsavetodb').click(function(){
|
||||
data: sendData,
|
||||
|
||||
success: function(){
|
||||
|
||||
invnom = '';
|
||||
vednumber = '';
|
||||
kolvo = '';
|
||||
balancenumber = '';
|
||||
matcen = '';
|
||||
rasp = '';
|
||||
changeddata = []
|
||||
|
||||
$('#getmodal').modal('hide')
|
||||
|
||||
getAllData();
|
||||
}
|
||||
getAllData()
|
||||
|
||||
vednumber.value = '';
|
||||
kolvo.value = '';
|
||||
balancenumber.value = '';
|
||||
matcen.value = '';
|
||||
rasp.value = '';
|
||||
changeddata = []
|
||||
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user