Пример #1
0
    def get(self, **kwargs):
        print('GET Schedule', kwargs, request.args, request.form, request.data)
        task = TaskGetSchedule(**request.args.to_dict())
        schedule_list = task.execute()

        result = {'success': True, 'result': schedule_list}
        return json.dumps(result, indent=4, sort_keys=True, cls=new_alchemy_encoder(), check_circular=False)
        pass
Пример #2
0
 def put(self):
     print('AUTH Terminal', request.args, request.form, request.data)
     task = TaskSaveTerminal(mac_address=request.form['mac_address'], ip_address=request.remote_addr)
     if 'label' in request.form:
         task.label = request.form['label']
     result = {'success': True, 'result': task.execute()}
     print('task Finish')
     return json.dumps(result, indent=4, sort_keys=True, cls=new_alchemy_encoder(), check_circular=False)
     pass
Пример #3
0
 def get(self, schedule_id):
     print 'GET ONE Schedule', schedule_id
     task = TaskGetSchedule(id=schedule_id)
     result = {'success': True, 'result': task.execute()}
     return json.dumps(result, indent=4, sort_keys=True, cls=new_alchemy_encoder(), check_circular=False)