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

Unified Diff: appengine/findit/model/base_try_job.py

Issue 2605803002: [Findit] Refactoring WfTryJobData into BaseTryJobData, WfTryJobData, and FlakeTryJobData (Closed)
Patch Set: Fixing code coverage Created 3 years, 11 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/findit/model/base_try_job.py
diff --git a/appengine/findit/model/base_try_job.py b/appengine/findit/model/base_try_job.py
index ea8f0293315ec3ae325ba0f94c266ddc54d2d206..0623e8ae202b9cba879a4b07a12acb8bb5f46268 100644
--- a/appengine/findit/model/base_try_job.py
+++ b/appengine/findit/model/base_try_job.py
@@ -25,3 +25,19 @@ class BaseTryJob(ndb.Model):
@property
def failed(self):
return self.status == analysis_status.ERROR
+
+ @classmethod
+ def GetMasterName(cls, key):
+ return key.pairs()[0][1].split('/')[0]
+
+ @classmethod
+ def GetBuilderName(cls, key):
+ return key.pairs()[0][1].split('/')[1]
+
+ @ndb.ComputedProperty
+ def master_name(self):
+ return self.GetMasterName(self.key)
+
+ @ndb.ComputedProperty
+ def builder_name(self):
+ return self.GetBuilderName(self.key)
« no previous file with comments | « appengine/findit/handlers/test/try_job_dashboard_test.py ('k') | appengine/findit/model/base_try_job_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698