From 5ef9c4f0f9a980d6a72b3727bbb9d097ba21d80e Mon Sep 17 00:00:00 2001 From: Stefano Assenzo Date: Thu, 26 Jan 2023 17:12:51 +0000 Subject: [PATCH] Fix JSON database MongoDB --- src/events/school_time/update_time_school.py | 292 +++++++++---------- 1 file changed, 146 insertions(+), 146 deletions(-) diff --git a/src/events/school_time/update_time_school.py b/src/events/school_time/update_time_school.py index 103d5e8..40684ae 100644 --- a/src/events/school_time/update_time_school.py +++ b/src/events/school_time/update_time_school.py @@ -40,254 +40,254 @@ def update_time_school(): "School Subject": { "Monday": [ { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, ], "Tuesday": [ { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, ], "Wednesday": [ { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, ], "Thursday": [ { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, ], "Friday": [ { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, ], "Saturday": [ { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, { - "Subject": "null", - "Teacher": "null", - "Room": "null", + "Subject": "", + "Teacher": "", + "Room": "", }, ], } @@ -330,7 +330,7 @@ def update_time_school(): dont_repeat = 0 else: 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 gagaga += 1 dont_repeat += 1 @@ -372,7 +372,7 @@ def update_time_school(): array_test = [] array_test.append(convert_date_to_day) 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_archive_school_time_table = list(collection_archive.find({}, {"Date": long_date})) array_document_school_time_table = find_document_school_time_table[0]["_id"]