Total Complexity | 3 |
Total Lines | 14 |
Duplicated Lines | 0 % |
1 | from flask.ext.restful import Resource |
||
13 | class ModelVersion(Resource): |
||
14 | def __init__(self): |
||
15 | # TODO: only example code |
||
16 | self.reqparse = reqparse.RequestParser() |
||
17 | self.reqparse.add_argument("title", type=str, required=True, |
||
18 | help="No task title provided", location="json") |
||
19 | self.reqparse.add_argument("description", type=str, default="", location="json") |
||
20 | super(ModelVersion, self).__init__() |
||
21 | |||
22 | def get(self): |
||
23 | return {"Version": "1.0"} |
||
24 | |||
25 | def put(self, version): |
||
26 | args = self.reqparse.parse_args() |
||
27 | |||
33 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.