aboutsummaryrefslogtreecommitdiffstats
path: root/rrs/models.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-02-15 13:53:52 -0600
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:51 +1200
commit446220e8c9ae2bdc7f958da3735e162ae095a6b1 (patch)
tree88be7b7262fda878316310571a3efe53658c8338 /rrs/models.py
parent22af5216de6c1736e7374d00a16de7ea3d70e66c (diff)
downloadopenembedded-core-contrib-446220e8c9ae2bdc7f958da3735e162ae095a6b1.tar.gz
rrs: Add support to display version by Milestone based on RecipeUpgrade's
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'rrs/models.py')
-rw-r--r--rrs/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/rrs/models.py b/rrs/models.py
index 973d0b7a0dc..343f257489f 100644
--- a/rrs/models.py
+++ b/rrs/models.py
@@ -255,6 +255,16 @@ class RecipeUpgrade(models.Model):
author_date = models.DateTimeField()
commit_date = models.DateTimeField()
+ @staticmethod
+ def get_by_recipe_and_date(recipe, current_date):
+ rup_qry = RecipeUpgrade.objects.filter(recipe = recipe,
+ commit_date__lte = current_date).order_by('commit_date')
+
+ if rup_qry:
+ return rup_qry[0]
+ else:
+ return None
+
def short_sha1(self):
return self.sha1[0:6]