|
|
@ -1,5 +1,6 @@
|
|
|
|
import json
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
|
|
|
|
import json
|
|
|
|
import sqlalchemy
|
|
|
|
import sqlalchemy
|
|
|
|
from sqlalchemy.sql import select
|
|
|
|
from sqlalchemy.sql import select
|
|
|
|
from sqlalchemy.sql import text
|
|
|
|
from sqlalchemy.sql import text
|
|
|
@ -97,7 +98,7 @@ def alter(partID):
|
|
|
|
datasheet_file = request.files['datasheet-file']
|
|
|
|
datasheet_file = request.files['datasheet-file']
|
|
|
|
datasheet_filename = secure_filename(datasheet_file.filename)
|
|
|
|
datasheet_filename = secure_filename(datasheet_file.filename)
|
|
|
|
datasheet_file.save('/srv/datasheets/' + datasheet_filename)
|
|
|
|
datasheet_file.save('/srv/datasheets/' + datasheet_filename)
|
|
|
|
# TODO: Remove old datasheet
|
|
|
|
os.remove('/srv/datasheets/' + l[0]['datasheet'])
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
datasheet_filename = l[0]['datasheet']
|
|
|
|
datasheet_filename = l[0]['datasheet']
|
|
|
|
s += 'where id=:id;'
|
|
|
|
s += 'where id=:id;'
|
|
|
|