From 73ae5e89fa69a86356514fbae760d73d21cc95aa Mon Sep 17 00:00:00 2001 From: James Turk Date: Sat, 30 Jun 2012 21:29:02 -0400 Subject: [PATCH] getting closer on the editing part --- fowl/game/templates/edit_event.html | 117 ++++++++++++++++++---------- fowl/game/views.py | 7 ++ 2 files changed, 83 insertions(+), 41 deletions(-) diff --git a/fowl/game/templates/edit_event.html b/fowl/game/templates/edit_event.html index c6b5eaa..17b46eb 100644 --- a/fowl/game/templates/edit_event.html +++ b/fowl/game/templates/edit_event.html @@ -6,17 +6,26 @@ {% endblock %} diff --git a/fowl/game/views.py b/fowl/game/views.py index cc975bd..0da8d3b 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -1,3 +1,4 @@ +import json from itertools import izip_longest from collections import defaultdict from django.shortcuts import render, get_object_or_404 @@ -74,8 +75,14 @@ def edit_event(request, event): # (would fix for case if title changes twice) event = event.to_dict() + if event: + match_json = json.dumps(event['matches']) + else: + match_json = [] + return render(request, "edit_event.html", {'event': event, + 'match_json': match_json, 'stars': Star.objects.all(), 'OUTCOMES': OUTCOMES, 'TITLES': TITLES}