Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1547)

Unified Diff: appengine/chromium_cq_status/handlers/query.py

Issue 515093004: chromium-cq-status: StatsTest utility class for testing CQ stats (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/chromium_cq_status/handlers/query.py
diff --git a/appengine/chromium_cq_status/handlers/query.py b/appengine/chromium_cq_status/handlers/query.py
index 4c15c7faac8d69c2778302b8b2c6e40b15029a8a..aebf6fb064e2bc264f63991c568fdbf79597b5d6 100644
--- a/appengine/chromium_cq_status/handlers/query.py
+++ b/appengine/chromium_cq_status/handlers/query.py
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import json
-import calendar
from google.appengine.datastore.datastore_query import Cursor
import webapp2
@@ -55,16 +54,8 @@ def execute_query(
if matches_fields(fields, record):
records.append(record)
- results = []
- for record in records:
- result = record.to_dict(exclude=['timestamp'])
- result['timestamp'] = calendar.timegm(record.timestamp.timetuple())
- record_key = record.key.id()
- result['key'] = record_key if type(record_key) != long else None
- results.append(result)
-
return {
- 'results': results,
+ 'results': [record.to_dict() for record in records],
'cursor': next_cursor,
'more': more,
}
« no previous file with comments | « no previous file | appengine/chromium_cq_status/model/record.py » ('j') | appengine/chromium_cq_status/model/record.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698