fix party, csv

This commit is contained in:
James Turk 2024-09-18 12:45:53 -05:00
parent 2ac2ea5dac
commit e6bd7292d5
2 changed files with 5 additions and 1 deletions

4
export_csv.sql Normal file
View File

@ -0,0 +1,4 @@
.headers on
.mode csv
.output legislators.csv
select name, given_name, family_name, gender, party, jurisdiction, r.district, r.type from person join personrole r on r.person_id=person.id where r.end_date is null;

View File

@ -37,7 +37,7 @@ def load_people_yaml(dir_path: pathlib.Path) -> int:
gender=pdata.pop("gender"),
email=pdata.pop("email", ""),
image=pdata.pop("image", ""),
party=pdata.pop("party"),
party=pdata.pop("party", [{"name": ""}])[0]["name"],
extras=pdata.pop("extras", {}),
)
to_links(person, pdata.pop("links", []), PersonLink)