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

Unified Diff: appengine/findit/model/wf_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
« no previous file with comments | « appengine/findit/model/test/wf_try_job_data_test.py ('k') | appengine/findit/model/wf_try_job_data.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/wf_try_job.py
diff --git a/appengine/findit/model/wf_try_job.py b/appengine/findit/model/wf_try_job.py
index a34c9dbb3efe064b31a8f7537791370d56264df0..34137baac311e1e8336b4c25f19c16a83b552960 100644
--- a/appengine/findit/model/wf_try_job.py
+++ b/appengine/findit/model/wf_try_job.py
@@ -62,3 +62,11 @@ class WfTryJob(BaseTryJob, BaseBuildModel):
def Get(master_name, builder_name, build_number):
return WfTryJob._CreateKey(
master_name, builder_name, build_number).get()
+
+ @classmethod
+ def GetBuildNumber(cls, key):
+ return int(key.pairs()[0][1].split('/')[2])
+
+ @ndb.ComputedProperty
+ def build_number(self):
+ return self.GetBuildNumber(self.key)
« no previous file with comments | « appengine/findit/model/test/wf_try_job_data_test.py ('k') | appengine/findit/model/wf_try_job_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698