+
+
Prospective Parliamentary Candidates
+
+
+
+ PPC |
+ Party |
+
+
+
+ {% for row in PPCs %}
+
+ {{ row.person }} |
+ {{ row.party }} |
+
+ {% endfor %}
+
+
+
+
{% endif %}
+
{% if categories.opinion %}
Public opinion
diff --git a/hub/views/area.py b/hub/views/area.py
index ea0b6f1d4..d166931b9 100644
--- a/hub/views/area.py
+++ b/hub/views/area.py
@@ -11,6 +11,7 @@
AreaData,
AreaType,
DataSet,
+ DataType,
Person,
PersonData,
UserDataSets,
@@ -200,13 +201,22 @@ def get_context_data(self, **kwargs):
context["overlap_constituencies"] = self.get_overlap_info()
context["area_type"] = str(self.object.area_type)
+ if context["area_type"] == "WMC23":
+ context["PPCs"] = [
+ {
+ "person": p,
+ "party": PersonData.objects.get(
+ person=p, data_type=DataType.objects.get(name="party")
+ ).value(),
+ }
+ for p in Person.objects.filter(area=self.object, person_type="PPC")
+ ]
try:
context["mp"] = {
"person": Person.objects.get(
area=self.object, person_type="MP", end_date__isnull=True
)
}
-
data = PersonData.objects.filter(
person=context["mp"]["person"]
).select_related("data_type")