From 12225f0a33e4adcfb894e9216b010b1c1a6a0cbb Mon Sep 17 00:00:00 2001 From: Erin Braswell Date: Mon, 28 May 2012 20:03:05 -0400 Subject: [PATCH] a few tweaks to make the dropdown work better --- fowl/game/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fowl/game/views.py b/fowl/game/views.py index 4887e6b..b092a72 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -5,6 +5,7 @@ from fowl.game.models import Team, TeamPoints, Star, Event, League def events(request, league_id): league = get_object_or_404(League, pk = league_id) + leagues = League.objects.all() events = {} points = TeamPoints.objects.filter(team__league_id=league_id).order_by( 'match', 'team').select_related() @@ -19,7 +20,7 @@ def events(request, league_id): events[event_id].scores.setdefault(tp.team, 0) events[event_id].scores[tp.team] += tp.points events = sorted(events.values(), key=lambda x: x.date, reverse=True) - return render(request, "events.html", {'events': events, 'view': 'events', 'league': league}) + return render(request, "events.html", {'events': events, 'view': 'events', 'league': league, 'leagues':leagues}) def edit_event(request, event_id=None):