From 462b86646cd4fc6c4885790e99218aa52a56283d Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Mon, 5 Jun 2017 14:14:43 +0800 Subject: show community results show latest 20 results in cummunity results page. Because pagination is not supported, pagination related buttons are forbiddened now Change-Id: I3d94fc1b89845b6583dd40fe86d69407adfd2e6c Signed-off-by: SerenaFeng --- testapi/opnfv_testapi/resources/result_handlers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'testapi/opnfv_testapi/resources/result_handlers.py') diff --git a/testapi/opnfv_testapi/resources/result_handlers.py b/testapi/opnfv_testapi/resources/result_handlers.py index 214706f..b84d1e3 100644 --- a/testapi/opnfv_testapi/resources/result_handlers.py +++ b/testapi/opnfv_testapi/resources/result_handlers.py @@ -47,7 +47,7 @@ class GenericResultHandler(handlers.GenericApiHandler): query['start_date'] = obj elif k == 'trust_indicator': query[k + '.current'] = float(v) - elif k != 'last': + elif k != 'last' and k != 'page': query[k] = v return query @@ -126,6 +126,10 @@ class ResultsCLHandler(GenericResultHandler): if last is not None: last = self.get_int('last', last) + page = self.get_query_argument('page', 0) + if page: + last = 20 + self._list(query=self.set_query(), sort=[('start_date', -1)], last=last) -- cgit 1.2.3-korg