summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-02-05 11:41:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:21 +0000
commit18d8b170520817c4307345631a8b804ada0f21ab (patch)
tree4903ed1554c9c2cf45d51348041a122e51014349 /bitbake/lib/toaster
parent8885b7bfd314f9c654cf7a0937f00f5071fdb970 (diff)
downloadpoky-18d8b170520817c4307345631a8b804ada0f21ab.tar.gz
bitbake: toaster: models add get_last_successful_built_target method
Add a convenience method to get the last successful build target for a CustomImageRecipe. (Bitbake rev: 4dde3d830cd38bbe306d83629dcb80da5fc9b027) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r--bitbake/lib/toaster/orm/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 7f7b1f37e9..9bfc00d667 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1447,6 +1447,13 @@ class CustomImageRecipe(Recipe):
1447 base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe') 1447 base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe')
1448 project = models.ForeignKey(Project) 1448 project = models.ForeignKey(Project)
1449 1449
1450 def get_last_successful_built_target(self):
1451 """ Return the last successful built target object if one exists
1452 otherwise return None """
1453 return Target.objects.filter(Q(build__outcome=Build.SUCCEEDED) &
1454 Q(build__project=self.project) &
1455 Q(target=self.name)).last()
1456
1450 def get_all_packages(self): 1457 def get_all_packages(self):
1451 """Get the included packages and any appended packages""" 1458 """Get the included packages and any appended packages"""
1452 return CustomImagePackage.objects.filter((Q(recipe_appends=self) | 1459 return CustomImagePackage.objects.filter((Q(recipe_appends=self) |