diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebKitTools/QueueStatusServer/handlers/recentstatus.py | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebKitTools/QueueStatusServer/handlers/recentstatus.py')
-rw-r--r-- | WebKitTools/QueueStatusServer/handlers/recentstatus.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/WebKitTools/QueueStatusServer/handlers/recentstatus.py b/WebKitTools/QueueStatusServer/handlers/recentstatus.py index e2b8c2f..fddc93a 100644 --- a/WebKitTools/QueueStatusServer/handlers/recentstatus.py +++ b/WebKitTools/QueueStatusServer/handlers/recentstatus.py @@ -31,23 +31,24 @@ import datetime from google.appengine.ext import webapp from google.appengine.ext.webapp import template -from model.queues import queues, display_name_for_queue +from model.queues import Queue from model.queuestatus import QueueStatus from model.workitems import WorkItems class QueueBubble(object): """View support class for recentstatus.html""" - def __init__(self, queue_name): - self._queue_name = queue_name - self._work_items = WorkItems.all().filter("queue_name =", queue_name).get() - self._last_status = QueueStatus.all().filter("queue_name =", queue_name).order("-date").get() + def __init__(self, queue): + self._queue = queue + self._work_items = queue.work_items() + self._last_status = QueueStatus.all().filter("queue_name =", queue.name()).order("-date").get() + # FIXME: name and display_name should be replaced by a .queue() accessor. def name(self): - return self._queue_name + return self._queue.name() def display_name(self): - return display_name_for_queue(self._queue_name) + return self._queue.display_name() def _last_status_date(self): if not self._last_status: @@ -88,6 +89,6 @@ class QueuesOverview(webapp.RequestHandler): def get(self): template_values = { - "queues": [QueueBubble(queue_name) for queue_name in queues], + "queues": [QueueBubble(queue) for queue in Queue.all()], } self.response.out.write(template.render("templates/recentstatus.html", template_values)) |