Merge branch 'master' of github.com:jamesturk/fowl

This commit is contained in:
James Turk 2012-06-01 01:09:06 -04:00
commit 8d2ad2bed2
2 changed files with 18 additions and 6 deletions

View File

@ -11,16 +11,27 @@
<table class="table">
<thead>
<tr>
<th>Stars</th>
<th>Raw</th>
<th>Smackdown</th>
<th>Divas</th>
</tr>
</thead>
<tbody>
{% for star in stars %}
{% for star_set in star_sets %}
<tr>
<td>{{star}}<span class="label {{star.division}}">{{star.division}}</span></td>
{% for star in star_set %}
<td>{{star}}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<h2>Others</h2>
<ul>
{% for other in others %}
<li>{{other}}</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -159,10 +159,11 @@ def roster(request, league_id):
divisions = {'raw': [], 'smackdown': [], 'other': [], 'divas': []}
for star in Star.objects.all():
divisions[star.division].append(star)
stars = izip_longest(divisions['raw'], divisions['smackdown'],
divisions['divas'], divisions['other'])
star_sets = izip_longest(divisions['raw'], divisions['smackdown'],
divisions['divas'], fillvalue='')
context = {
'stars': stars,
'star_sets': star_sets,
'others': divisions['other'],
'view': 'roster',
'league': league,
'leagues': leagues