예제 #1
0
파일: create_task.py 프로젝트: Liutos/nest
 def __init__(self):
     args = {
         'brief': fields.Str(required=True),
         'keywords': fields.List(fields.Str(), missing=[]),
     }
     parsed_args = parser.parse(args, request)
     self.brief = parsed_args['brief']
     self.keywords = parsed_args['keywords']
예제 #2
0
 def __init__(self):
     args = {
         'location_id': fields.Int(allow_none=True),
         'size': fields.Int(required=True),
     }
     parsed_args = parser.parse(args, request)
     self.location_id = parsed_args.get('location_id')
     self.size = parsed_args['size']
예제 #3
0
파일: change_task.py 프로젝트: Liutos/nest
 def __init__(self, *, task_id: str):
     args = {
         'brief': fields.Str(),
         'keywords': fields.List(fields.Str()),
         'status': fields.Int(),
     }
     self.parsed_args = parser.parse(args, request)
     self.task_id = int(task_id)
예제 #4
0
 def __init__(self):
     args = {
         'email': fields.Str(required=True),
         'password': fields.Str(required=True),
     }
     parsed_args = parser.parse(args, request)
     self.email = parsed_args['email']
     self.password = parsed_args['password']
예제 #5
0
파일: list_plan.py 프로젝트: Liutos/nest
 def __init__(self):
     args = {
         'location_id': fields.Int(allow_none=True),
         'page': fields.Int(missing=1, validate=validate.Range(min=1)),
         'per_page': fields.Int(missing=10, validate=validate.Range(min=1)),
     }
     parsed_args = parser.parse(args, request, location='querystring')
     self.location_id = parsed_args.get('location_id')
     self.page = parsed_args['page']
     self.per_page = parsed_args['per_page']
예제 #6
0
 def __init__(self):
     args = {
         'ids': fields.DelimitedList(fields.Int, allow_none=True),
         'name': fields.Str(allow_none=True),
         'page': fields.Int(missing=1, validate=validate.Range(min=1)),
         'per_page': fields.Int(missing=10, validate=validate.Range(min=1)),
     }
     parsed_args = parser.parse(args, request, location='querystring')
     self.ids = parsed_args.get('ids')
     self.name = parsed_args.get('name')
     self.page = parsed_args['page']
     self.per_page = parsed_args['per_page']
예제 #7
0
파일: change_plan.py 프로젝트: Liutos/nest
 def __init__(self, *, plan_id):
     self.plan_id = plan_id
     args = {
         'duration': fields.Int(allow_none=True),
         'location_id': fields.Int(allow_none=True),
         'repeat_interval': fields.TimeDelta(allow_none=True),
         'repeat_type': fields.Str(allow_none=True),
         'trigger_time': fields.DateTime('%Y-%m-%d %H:%M:%S'),
         'visible_hours': fields.List(fields.Int, allow_none=True),
         'visible_wdays': fields.List(fields.Int, allow_none=True),
     }
     parsed_args = parser.parse(args, request)
     self.parsed_args = parsed_args
예제 #8
0
파일: list_task.py 프로젝트: Liutos/nest
 def __init__(self):
     args = {
         'keyword': fields.Str(),
         'page': fields.Int(missing=1, validate=validate.Range(min=1)),
         'per_page': fields.Int(missing=10, validate=validate.Range(min=1)),
         'plan_trigger_time': fields.DelimitedList(fields.DateTime()),
         'status': fields.Int(),
         'task_ids': fields.DelimitedList(fields.Int()),
     }
     parsed_args = parser.parse(args, request, location='querystring')
     self.count = parsed_args['per_page']
     self.keyword = parsed_args.get('keyword')
     self.plan_trigger_time = parsed_args.get('plan_trigger_time')
     self.start = (parsed_args['page'] - 1) * parsed_args['per_page']
     self.status = parsed_args.get('status')
     self.task_ids = parsed_args.get('task_ids')
예제 #9
0
 def __init__(self):
     args = {
         'duration': fields.Int(allow_none=True),
         'location_id': fields.Int(allow_none=True),
         'repeat_interval': fields.TimeDelta(allow_none=True),
         'repeat_type': fields.Str(allow_none=True),
         'task_id': fields.Int(required=True),
         'trigger_time': fields.DateTime('%Y-%m-%d %H:%M:%S',
                                         required=True),
         'visible_hours': fields.List(fields.Int, allow_none=True),
         'visible_wdays': fields.List(fields.Int, allow_none=True),
     }
     parsed_args = parser.parse(args, request)
     self.duration = parsed_args.get('duration')
     self.location_id = parsed_args.get('location_id')
     self.repeat_interval = parsed_args.get('repeat_interval')
     self.repeat_type = parsed_args.get('repeat_type')
     self.task_id = parsed_args['task_id']
     self.trigger_time = parsed_args['trigger_time']
     self.visible_hours = set(parsed_args.get('visible_hours') or [])
     self.visible_wdays = set(parsed_args.get('visible_wdays') or [])
예제 #10
0
 def __init__(self):
     args = {
         'name': fields.Str(required=True),
     }
     parsed_args = parser.parse(args, request)
     self.name = parsed_args['name']