diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-05-31 20:44:03 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-05-31 20:45:57 +0800 |
commit | c6ace67b6c587663dd83b5aa6afb126380e16678 (patch) | |
tree | 76febbcad1ea4cd5da1043e35a3895350c945abe /result_collection_api/resources | |
parent | cd68f499572ae87b1aa3213a389c8931a7035387 (diff) |
bugfix: query results failed due to wrong using type of trust_indicator
trust_indicator must be int/long/float rather than string
JIRA: FUNCTEST-280
Change-Id: I2e2b292f9181fd28896bfe1e3b86ec3976b65016
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/resources')
-rw-r--r-- | result_collection_api/resources/result_handlers.py | 4 | ||||
-rw-r--r-- | result_collection_api/resources/result_models.py | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/result_collection_api/resources/result_handlers.py b/result_collection_api/resources/result_handlers.py index e7fce47..1d52235 100644 --- a/result_collection_api/resources/result_handlers.py +++ b/result_collection_api/resources/result_handlers.py @@ -32,6 +32,8 @@ class GenericResultHandler(GenericApiHandler): period = datetime.now() - timedelta(days=v) obj = {"$gte": str(period)} query['creation_date'] = obj + elif k == 'trust_indicator': + query[k] = float(v) else: query[k] = v return query @@ -98,7 +100,7 @@ class ResultsCLHandler(GenericResultHandler): @type period: L{string} @in period: query @required period: False - @param trust_indicator: must be integer + @param trust_indicator: must be int/long/float @type trust_indicator: L{string} @in trust_indicator: query @required trust_indicator: False diff --git a/result_collection_api/resources/result_models.py b/result_collection_api/resources/result_models.py index 27c3542..40d21c3 100644 --- a/result_collection_api/resources/result_models.py +++ b/result_collection_api/resources/result_models.py @@ -48,6 +48,10 @@ class ResultCreateRequest(object): @swagger.model() class TestResult(object): + """ + @property trust_indicator: must be int/long/float + @ptype trust_indicator: L{float} + """ def __init__(self, _id=None, case_name=None, project_name=None, pod_name=None, installer=None, version=None, start_date=None, stop_date=None, details=None, |