Add political parties dump

This commit is contained in:
Cassowary Rusnov 2022-03-01 08:17:20 -08:00
parent 164d6a806e
commit abd4b73829
1 changed files with 9 additions and 0 deletions

View File

@ -40,6 +40,7 @@ DUMP_TRIVIAL = ["FinancialType",
"OptionValue",
"Domain"]
# "ContributionPage", needs payment processors & payment_processor column formatted correctly.
# the payment_processor column is a string with an integer id in it
# create a stand-in payment processor, and set the payment_processor column to its id
@ -203,6 +204,14 @@ def main() -> int:
with output.open("w") as of:
of.write(json.dumps(data))
# dump org contacts
output = args.output / ("Contact.json")
data = api.get("Contact", where=[["contact_sub_type", "=", "Political_Party"]])
if data:
print("dumping parties")
with output.open("w") as of:
of.write(json.dumps(data))
if (args.command in ("load", "mysql")):
if (not args.input.exists()):
print("input directory does not exist")