| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from model.base_build_model import BaseBuildModel | 7 from model.base_build_model import BaseBuildModel |
| 8 from model.base_try_job import BaseTryJob | 8 from model.base_try_job import BaseTryJob |
| 9 | 9 |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 key=WfTryJob._CreateKey(master_name, builder_name, build_number)) | 55 key=WfTryJob._CreateKey(master_name, builder_name, build_number)) |
| 56 try_job.compile_results = try_job.compile_results or [] | 56 try_job.compile_results = try_job.compile_results or [] |
| 57 try_job.test_results = try_job.test_results or [] | 57 try_job.test_results = try_job.test_results or [] |
| 58 try_job.try_job_ids = try_job.try_job_ids or [] | 58 try_job.try_job_ids = try_job.try_job_ids or [] |
| 59 return try_job | 59 return try_job |
| 60 | 60 |
| 61 @staticmethod | 61 @staticmethod |
| 62 def Get(master_name, builder_name, build_number): | 62 def Get(master_name, builder_name, build_number): |
| 63 return WfTryJob._CreateKey( | 63 return WfTryJob._CreateKey( |
| 64 master_name, builder_name, build_number).get() | 64 master_name, builder_name, build_number).get() |
| 65 |
| 66 @classmethod |
| 67 def GetBuildNumber(cls, key): |
| 68 return int(key.pairs()[0][1].split('/')[2]) |
| 69 |
| 70 @ndb.ComputedProperty |
| 71 def build_number(self): |
| 72 return self.GetBuildNumber(self.key) |
| OLD | NEW |