From 0c1ee1d0a7d50b8682dfe5780ec1bd0f01dd6d46 Mon Sep 17 00:00:00 2001
From: Branson Stephens <stephenb@uwm.edu>
Date: Thu, 10 Jan 2013 15:28:04 -0600
Subject: [PATCH] added slots to EventDetail api view.

---
 gracedb/api.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gracedb/api.py b/gracedb/api.py
index 146c721a8..f3d2ebe62 100644
--- a/gracedb/api.py
+++ b/gracedb/api.py
@@ -116,6 +116,11 @@ def eventToDict(event, columns=None, request=None):
             "labels" : reverse("labels", args=[graceid], request=request),
             "self"  : reverse("event-detail", args=[graceid], request=request),
             }
+    # XXX Jam the slots in here? Could just have a list of slot names instead of
+    # all these links.  But the links might be useful??
+    rv['slots'] = {}
+    for slot in Slot.objects.filter(event=event).order_by('name'):
+        rv['slots'][slot.name] = reverse("slot", args=[graceid, slot.name], request=request)
     return rv
 
 
-- 
GitLab