diff --git a/representatives/management/commands/export_in_representatives_format.py b/representatives/management/commands/export_in_representatives_format.py index 2b70530d36c2d673e2cf61f382287ffedcbce0ed..aff7eaa5167f999c710ad31321dc3fedf9bfd341 100644 --- a/representatives/management/commands/export_in_representatives_format.py +++ b/representatives/management/commands/export_in_representatives_format.py @@ -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)