diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2015-02-05 18:09:34 -0600 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-05-04 23:57:51 +1200 |
commit | 0013db9bc7d26a8cf95f2e3c92eb12933d76b789 (patch) | |
tree | 53e0b520adcd5ad72e7c879e9afc7ce256c771a6 /rrs/models.py | |
parent | e4d1db864dee650c8e1ad4900dc420ca8ed6526e (diff) | |
download | openembedded-core-contrib-0013db9bc7d26a8cf95f2e3c92eb12933d76b789.tar.gz |
rrs: Add support for display Can't be updated recipe upstream status.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'rrs/models.py')
-rw-r--r-- | rrs/models.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rrs/models.py b/rrs/models.py index ee6288e1ac4..973d0b7a0dc 100644 --- a/rrs/models.py +++ b/rrs/models.py @@ -12,6 +12,7 @@ sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../ from datetime import date from django.db import models +from django.db.models.query import Q from layerindex.models import Recipe class Milestone(models.Model): @@ -166,6 +167,7 @@ class RecipeUpstream(models.Model): RECIPE_UPSTREAM_STATUS_CHOICES = ( ('A', 'All'), ('N', 'Not updated'), + ('C', 'Can\'t be updated'), ('Y', 'Up-to-date'), ('D', 'Downgrade'), ('U', 'Unknown'), @@ -186,6 +188,29 @@ class RecipeUpstream(models.Model): no_update_reason = models.CharField(max_length=255, blank=True) date = models.DateTimeField() + @staticmethod + def get_recipes_not_updated(history): + qry = RecipeUpstream.objects.filter(history = history, status = 'N', + no_update_reason = '').order_by('pn') + return qry + + @staticmethod + def get_recipes_cant_be_updated(history): + qry = RecipeUpstream.objects.filter(history = history, status = 'N') \ + .exclude(no_update_reason = '').order_by('pn') + return qry + + @staticmethod + def get_recipes_up_to_date(history): + qry = RecipeUpstream.objects.filter(history = history, status = 'Y' \ + ).order_by('pn') + return qry + + @staticmethod + def get_recipes_unknown(history): + qry = RecipeUpstream.objects.filter(history = history, + status__in = ['U', 'D']).order_by('pn') + return qry @staticmethod def get_by_recipe_and_history(recipe, history): |