blob: 2aaa62c9f2801501672077b44879818677d87944 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
##############################################################################
# Copyright (c) 2019
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
from opnfv_testapi.resources import models
from opnfv_testapi.tornado_swagger import swagger
from datetime import datetime
@swagger.model()
class Review(models.ModelBase):
def __init__(self, _id=None, test_id=None, reviewer_openid=None,
reviewer_email=None, reviewer_name=None, creation_date=None,
outcome=None):
self._id = _id
self.test_id = test_id
self.reviewer_openid = reviewer_openid
self.reviewer_email = reviewer_email
self.reviewer_name = reviewer_name
self.creation_date = datetime.now()
self.outcome = outcome
@swagger.model()
class Reviews(models.ModelBase):
"""
@property reviews:
@ptype tests: C{list} of L{Review}
"""
def __init__(self):
self.reviews = list()
@staticmethod
def attr_parser():
return {'reviews': Review}
|