Skip to content

Commit

Permalink
Merge branch 'API-model' of https://github.com/NewWays-TechForImpactK…
Browse files Browse the repository at this point in the history
  • Loading branch information
happycastle114 committed Nov 17, 2023
2 parents d7d2442 + 13f43ca commit 3df7eaa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions API/MongoDB.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import dataclass


@dataclass
class Councilor:
sdName: str
Expand All @@ -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"),
)
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"),
)
2 changes: 1 addition & 1 deletion API/candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

return data_list
Expand Down

0 comments on commit 3df7eaa

Please sign in to comment.