Commit 262ded36 authored by Bram's avatar Bram
Browse files

[enh] export mandates

parent 2d4666f8
......@@ -35,6 +35,18 @@ class Command(BaseCommand):
"phones": [phone.id for phone in address.phone_set.all()],
} for address in representative.address_set.all()]
reps["mandates"] = [{
"name": mandate.name,
"type": mandate.kind,
"short_id": mandate.short_id,
"url_official": mandate.url,
"constituency": mandate.constituency,
"role": mandate.role,
"begin_date": mandate.begin_date.strftime("%F") if mandate.begin_date else None,
"end_date": mandate.end_date.strftime("%F") if mandate.end_date else None,
"current": mandate.active,
} for mandate in representative.mandate_set.all()]
result.append(reps)
print json.dumps(result, indent=4)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment