diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2015-02-15 13:53:52 -0600 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-05-04 23:57:51 +1200 |
commit | 446220e8c9ae2bdc7f958da3735e162ae095a6b1 (patch) | |
tree | 88be7b7262fda878316310571a3efe53658c8338 /rrs/models.py | |
parent | 22af5216de6c1736e7374d00a16de7ea3d70e66c (diff) | |
download | openembedded-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.py | 10 |
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] |