forked from DevProjectsForDevOps/StudentCoursesRestAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
28 lines (23 loc) · 669 Bytes
/
utils.py
File metadata and controls
28 lines (23 loc) · 669 Bytes
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
from flask_restplus import reqparse, fields, Api
def get_course_parser():
"""
This method returns the course parse
:return:
"""
course_parser = reqparse.RequestParser()
course_parser.add_argument('id', type=int)
course_parser.add_argument('name')
course_parser.add_argument('faculty')
course_parser.add_argument('duration', type=int)
return course_parser
def get_course_model(api):
"""
:type api: Api
"""
course_model = api.model('CourseModel', {
'id': fields.Integer,
'name': fields.String,
'faculty': fields.String,
'duration': fields.Integer
})
return course_model