diff --git a/representatives/management/__init__.py b/representatives/management/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/representatives/management/commands/.export_in_representatives_format.py.swp b/representatives/management/commands/.export_in_representatives_format.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..cc7b6bab645dfc8cdc2fe50919936815a3aa9e2b Binary files /dev/null and b/representatives/management/commands/.export_in_representatives_format.py.swp differ diff --git a/representatives/management/commands/__init__.py b/representatives/management/commands/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/representatives/management/commands/export_in_representatives_format.py b/representatives/management/commands/export_in_representatives_format.py new file mode 100644 index 0000000000000000000000000000000000000000..0a8176531431b5e9abb7329efefef9d6bae843a6 --- /dev/null +++ b/representatives/management/commands/export_in_representatives_format.py @@ -0,0 +1,16 @@ +import json +from representatives.models import Representative +from django.core.management.base import BaseCommand + +class Command(BaseCommand): + args = '<poll_id poll_id ...>' + help = 'Closes the specified poll for voting' + + def handle(self, *args, **options): + result = [] + for representative in Representative.objects.all(): + reps = {"id": representative.remote_id} + + result.append(reps) + + print json.dumps(result, indent=4)