Fix JSON database MongoDB

This commit is contained in:
Stefano Assenzo 2023-01-26 17:12:51 +00:00 committed by GitHub
parent debaf06011
commit 5ef9c4f0f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 146 additions and 146 deletions

View File

@ -40,254 +40,254 @@ def update_time_school():
"School Subject": { "School Subject": {
"Monday": [ "Monday": [
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
], ],
"Tuesday": [ "Tuesday": [
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
], ],
"Wednesday": [ "Wednesday": [
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
], ],
"Thursday": [ "Thursday": [
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
], ],
"Friday": [ "Friday": [
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
], ],
"Saturday": [ "Saturday": [
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
{ {
"Subject": "null", "Subject": "",
"Teacher": "null", "Teacher": "",
"Room": "null", "Room": "",
}, },
], ],
} }
@ -330,7 +330,7 @@ def update_time_school():
dont_repeat = 0 dont_repeat = 0
else: else:
if day == "None": if day == "None":
if school_subject == 0: #If school subject is 0, add "null" in MongoDB if school_subject == 0: #If school subject is 0, add "" in MongoDB
number += 1 number += 1
gagaga += 1 gagaga += 1
dont_repeat += 1 dont_repeat += 1
@ -372,7 +372,7 @@ def update_time_school():
array_test = [] array_test = []
array_test.append(convert_date_to_day) array_test.append(convert_date_to_day)
number_day += 1 number_day += 1
if school_subject == 0: #If school subject is 0, add "null" in MongoDB if school_subject == 0: #If school subject is 0, add "" in MongoDB
find_document_school_time_table = list(collection.find({}, {"Date": long_date})) find_document_school_time_table = list(collection.find({}, {"Date": long_date}))
find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date})) find_document_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date}))
array_document_school_time_table = find_document_school_time_table[0]["_id"] array_document_school_time_table = find_document_school_time_table[0]["_id"]