From 3cabf7cfb912527f83b07695812e7093eecdc53d Mon Sep 17 00:00:00 2001
From: Laurent Peuch <cortex@worlddomination.be>
Date: Sat, 22 Jun 2013 15:28:12 +0200
Subject: [PATCH] [enh] first version of export_in_representatives_format
 command

---
 representatives/management/__init__.py          |   0
 .../.export_in_representatives_format.py.swp    | Bin 0 -> 12288 bytes
 representatives/management/commands/__init__.py |   0
 .../export_in_representatives_format.py         |  16 ++++++++++++++++
 4 files changed, 16 insertions(+)
 create mode 100644 representatives/management/__init__.py
 create mode 100644 representatives/management/commands/.export_in_representatives_format.py.swp
 create mode 100644 representatives/management/commands/__init__.py
 create mode 100644 representatives/management/commands/export_in_representatives_format.py

diff --git a/representatives/management/__init__.py b/representatives/management/__init__.py
new file mode 100644
index 0000000..e69de29
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
GIT binary patch
literal 12288
zcmeI2!EO^V5Qbgu1w@Z<Fv}rn)jEYDfhx*@o;aiuNN_<Ya@MnngS|Fur)q_OCxDkg
z;z26lHFyF}@BoZ=H*FJCajr6!eoegoXKa5t?P`YGFQ4}L1F^$!TxYER_4~75C*N4M
z#+VPsxtq8*P^HC-hm}X#x}vz)(X4zpE7;4Of}Wbla^%{uRe`S{KpAD!hY)&;b1O?Z
z0*eOBwm4Iv2S?sjaiGh=f_qT7%E~DG@&8Um>qKA)2ux$K^>CH#+`GG-ZhI%Y&DU<c
zSb~ew6^Q^5AOb{y2oM1xKm>>Y5ttE(euaI+$(8m2egde+%0g_X6o>#3AOb{y2oM1x
zKm>>Y5g-CYfCvzQOGrQ}#(u0amR-fe<IDf-{r}H3#!gV5QJ+w6Q3t47sGF$Y=>LiO
zf^w)5b%5%l>ROkO1s$0P5CI}U1c(3;AOb{y2oM1xu-pWAJA9?f$S1*-LQSm?U2N8#
znz+ezsjw$|@BTVtGjEE`vXI_GsnG1hKL#K89)Fi<mF=SaeD}Agz`6(nt=^v&#g6U;
z7jDg;&*!<}1o9Y!G^V@0dz#xE26ub)x_+jh;A89{H_#1WicP*Dt5LwP;e6Dt447LR
z$6!3Bb@q)55O^E|4<2$|Xi(fcV|Y5&p^Lg4b?S^%C}liKt9XIhm7);hafjtbhQRlm
z2KMd~8KC{0b}TAqdD9gya#w*k>v<PLv~q1zzdJvd*5u673&LW1y$Lh>JR{Z?Nq;5#
E3p<hN1ONa4

literal 0
HcmV?d00001

diff --git a/representatives/management/commands/__init__.py b/representatives/management/commands/__init__.py
new file mode 100644
index 0000000..e69de29
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 0000000..0a81765
--- /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)
-- 
GitLab