aboutsummaryrefslogtreecommitdiffstats
path: root/rrs/models.py
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-06-26 14:35:31 -0500
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:52 +1200
commitfaafae13fa6bde4809bab65e6eb7ad049140b2ea (patch)
tree5fd69ea6e4821dd471284fba27b2bffed3d7326c /rrs/models.py
parenta9aff3cae665a9b80f3b06f45865a2239d739ac3 (diff)
downloadopenembedded-core-contrib-faafae13fa6bde4809bab65e6eb7ad049140b2ea.tar.gz
views.py: Add how long a recipe hasn't been updated
This add a tooltip in the upstream status field that show how long the recipe hasn't been updated. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'rrs/models.py')
-rw-r--r--rrs/models.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/rrs/models.py b/rrs/models.py
index e9cf787cca..a72fa63ddb 100644
--- a/rrs/models.py
+++ b/rrs/models.py
@@ -448,6 +448,21 @@ class Raw():
return Raw.dictfetchall(cur)
@staticmethod
+ def get_reup_by_last_updated(date):
+ cur = connection.cursor()
+ cur.execute("""SELECT te.recipe_id, te.status, te.date, te.rownum FROM(
+ SELECT recipe_id, status, date, ROW_NUMBER() OVER(
+ PARTITION BY recipe_id
+ ORDER BY date DESC
+ ) AS rownum
+ FROM rrs_RecipeUpstream
+ WHERE status = 'Y'
+ AND date <= %s) AS te
+ WHERE te.rownum = 1;
+ """, [date])
+ return Raw.dictfetchall(cur)
+
+ @staticmethod
def dictfetchall(cursor):
"Returns all rows from a cursor as a dict"
desc = cursor.description