Change upload to accomdate data

This commit is contained in:
Aaron Lee 2021-09-30 20:20:22 +08:00
parent 9edc8863c8
commit cab781f1ba

View file

@ -137,7 +137,7 @@ def upload_stud_in_group():
for row in csv_dict: for row in csv_dict:
for h in headers: for h in headers:
db.child("Homerooms").child(gradec).child(classc).child( db.child("Homerooms").child(gradec).child(classc).child(
row['number']).child("GP_Class").update({h: row[h]}, session['token']) str(gradec + classc)).child("GP_Class").update({h: row[h]}, session['token'])
os.remove(filepath) os.remove(filepath)
except Exception as e: except Exception as e:
os.remove(filepath) os.remove(filepath)
@ -201,6 +201,7 @@ def upload_dates():
temp = db.child("Homerooms").get(session['token']).val() temp = db.child("Homerooms").get(session['token']).val()
for row in csv_dict: for row in csv_dict:
for h in headers: for h in headers:
h = h.replace('/', '-')
for t in temp: for t in temp:
for i in temp[t]: for i in temp[t]:
periodData = db.child("Classes").child( periodData = db.child("Classes").child(