Browse files

add sisters who slated to slating results

  • Loading branch information...
1 parent f6f5b13 commit c909dfd0e8118c0b2c71f61d962e06c5f7cf4963 @leibovic committed Oct 22, 2011
Showing with 18 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +11 −1 website/templates/sistersonly/elections_slating_results.html
  3. +6 −1 website/views.py
View
1 .gitignore
@@ -1,3 +1,4 @@
*.pyc
*.DS_Store
settings.py
+NOTES
View
12 website/templates/sistersonly/elections_slating_results.html
@@ -20,7 +20,17 @@ <h2 class="loi-results-office">{{ result.office }}</h2>
</table>
{% endfor %}
- </table>
+ <h1>Sisters Who Slated</h1>
+ {% regroup slating_sisters|dictsort:"class_year" by class_year as class_year_list %}
+ {% for class_year in class_year_list %}
+ <h2>{{ class_year.grouper }}</h2>
+ <ul>
+ {% for sister in class_year.list|dictsort:"sort_rank" %}
+ <li>{{ sister.full_name }}</li>
+ {% endfor %}
+ </ul>
+ {% endfor %}
+
{% else %}
<p>Sorry, you don't have permission to view this page.</p>
{% endif %}
View
7 website/views.py
@@ -239,7 +239,12 @@ def sistersonly_elections_slating_results(request):
for vote in votes:
vote['candidate'] = Candidate.objects.get(id=vote['candidate']).sister
results.append({ 'office': office, 'votes': votes })
-
context['results'] = results
+
+ slating_sisters = []
+ voter_aggregate = Vote.objects.values('sister').order_by().annotate()
+ for item in voter_aggregate:
+ slating_sisters.append(Sister.objects.get(id=item['sister']))
+ context['slating_sisters'] = slating_sisters
return render_to_response('sistersonly/elections_slating_results.html', context)

0 comments on commit c909dfd

Please sign in to comment.