From 13f43ca254be2de8008566ee5cb9ca928f556491 Mon Sep 17 00:00:00 2001 From: happycastle114 Date: Fri, 17 Nov 2023 03:36:14 +0000 Subject: [PATCH] Formatted with black --- API/MongoDB.py | 25 +++++++++++++------------ API/candidate.py | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/API/MongoDB.py b/API/MongoDB.py index 0314c51..d58ca18 100644 --- a/API/MongoDB.py +++ b/API/MongoDB.py @@ -1,5 +1,6 @@ from dataclasses import dataclass + @dataclass class Councilor: sdName: str @@ -17,15 +18,15 @@ class Councilor: @classmethod def from_dict(cls, data: dict): return cls( - sdName = data.get("sdName"), - sggName = data.get("sggName"), - wiwName = data.get("wiwName"), - name = data.get("name"), - gender = data.get("gender"), - birthday = data.get("birthday"), - age = data.get("age"), - jobId = data.get("jobId"), - job = data.get("job"), - eduId = data.get("eduId"), - edu = data.get("edu"), - ) \ No newline at end of file + sdName=data.get("sdName"), + sggName=data.get("sggName"), + wiwName=data.get("wiwName"), + name=data.get("name"), + gender=data.get("gender"), + birthday=data.get("birthday"), + age=data.get("age"), + jobId=data.get("jobId"), + job=data.get("job"), + eduId=data.get("eduId"), + edu=data.get("edu"), + ) diff --git a/API/candidate.py b/API/candidate.py index e3f1fda..bcf2b3c 100644 --- a/API/candidate.py +++ b/API/candidate.py @@ -43,7 +43,7 @@ def fetch_data( data_entry = {child.tag: child.text for child in item} for column in drop_columns: data_entry.pop(column) - + data_list.append(Councilor.from_dict(data_entry)) print(data_list) return data_list