From 9c123853c73c5651d1b94201c620bd0441408b61 Mon Sep 17 00:00:00 2001 From: Yaron Date: Wed, 11 Jun 2014 22:46:34 +0300 Subject: [PATCH] added committee decisions --- .../management/commands/all_imports.py | 18 ++++++++++++-- committeeVotes/models.py | 2 +- .../templates/committeeVotes/detail.html | 24 +++++++++++++------ .../templates/committeeVotes/index.html | 12 ++++++++++ 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/committeeVotes/management/commands/all_imports.py b/committeeVotes/management/commands/all_imports.py index b30da19..e03cda7 100644 --- a/committeeVotes/management/commands/all_imports.py +++ b/committeeVotes/management/commands/all_imports.py @@ -13,7 +13,19 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "committeeVotes.settings") # Replace with your app name. -BILL_FIELDS = ['name','description', 'oknesset_url'] +def vote_to_bool(vote): + if not vote or vote == '': + return None + if vote == 'בעד': + return True + elif vote == 'נגד': + return False + +BILL_FIELDS = [ + ('name', None), + ('oknesset_url', None), + ('passed', vote_to_bool) +] # @@ -37,8 +49,10 @@ def handle(self, *args, **options): for d in r: bill = Bill() - for header in BILL_FIELDS: + for header, conv_func in BILL_FIELDS: value = d[header] + if conv_func: + value = conv_func(value) setattr(bill, header, value) try: bill.full_clean() diff --git a/committeeVotes/models.py b/committeeVotes/models.py index da19dbb..df53fd4 100644 --- a/committeeVotes/models.py +++ b/committeeVotes/models.py @@ -3,8 +3,8 @@ # Create your models here. class Bill(models.Model): name = models.CharField(max_length=500) - description = models.TextField() oknesset_url = models.CharField(max_length=100, blank=True, null=True) + passed = models.NullBooleanField() def __unicode__(self): return self.name diff --git a/committeeVotes/templates/committeeVotes/detail.html b/committeeVotes/templates/committeeVotes/detail.html index 463f9b6..24bf6b0 100644 --- a/committeeVotes/templates/committeeVotes/detail.html +++ b/committeeVotes/templates/committeeVotes/detail.html @@ -22,15 +22,25 @@

{% endif %} - - -
-
-
- {{ bill.description }} -
+{% if not bill.passed == None %} +
+
+

+החלטת הועדה: + {% if bill.passed %} + + בעד + + {% endif %} + {% if not bill.passed %} + +נגד + + {% endif %} +

+ {% endif %}
{% for vote_type, votes in votes_by_type %} diff --git a/committeeVotes/templates/committeeVotes/index.html b/committeeVotes/templates/committeeVotes/index.html index b3557f2..f39d1d2 100644 --- a/committeeVotes/templates/committeeVotes/index.html +++ b/committeeVotes/templates/committeeVotes/index.html @@ -2,6 +2,18 @@ {% block content %}
+
+
+

+רקע +

+
+ וועדת שרים לענייני חקיקה היא המקום בו הממשלה מחליטה האם היא תומכת או מתנגדת להצעות חוק. כל הצעות + החוק עוברות דרך הוועדה, וללא תמיכת הממשלה אין להצעת החוק כמעט שום סיכוי לעבור בכנסת. הוועדה מתנהלת + בחוסר שקיפות חריג, כך שכל המידע באתר נמסר מרצונם החופשי של שרים החברים בוועדה ותומכים בשקיפות. +
+
+