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

Unified Diff: dashboard/dashboard/pinpoint/models/job.py

Issue 3004223002: [pinpoint] Abbreviated Job dict for the Jobs listing page. (Closed)
Patch Set: Tests Created 3 years, 3 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
« no previous file with comments | « dashboard/dashboard/pinpoint/handlers/jobs_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/pinpoint/models/job.py
diff --git a/dashboard/dashboard/pinpoint/models/job.py b/dashboard/dashboard/pinpoint/models/job.py
index 6b7f9981432a433b9dd34da9fb5c3e07bc650977..e76c217db8ae57330926546738c484fd35b301e9 100644
--- a/dashboard/dashboard/pinpoint/models/job.py
+++ b/dashboard/dashboard/pinpoint/models/job.py
@@ -144,7 +144,8 @@ class Job(ndb.Model):
self.Fail()
raise
- def AsDict(self):
+ def StatusDict(self):
+ """A shorter version of AsDict() for faster Jobs list loading."""
return {
'job_id': self.job_id,
@@ -155,10 +156,13 @@ class Job(ndb.Model):
'updated': self.updated.isoformat(),
'exception': self.exception,
'status': self.status,
-
- 'state': self.state.AsDict(),
}
+ def AsDict(self):
+ d = self.StatusDict()
+ d['state'] = self.state.AsDict()
+ return d
+
class _JobState(object):
"""The internal state of a Job.
« no previous file with comments | « dashboard/dashboard/pinpoint/handlers/jobs_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698