Example #1
0
    def get(self):
        print('GET ALL Person', request.args)
        task = TaskGetPersonne(**request.args.to_dict())

        result = {'success': True, 'result': task.execute()}
        print('task Finish')
        return json.dumps(result, indent=4, sort_keys=True, cls=new_alchemy_encoder_v2(False, ['promotion']), check_circular=False)
Example #2
0
 def run(self):
     task = TaskGetPersonne()
     persons = task.execute()
     persons_size = len(persons)
     i = 0
     while True:
         sleep(5)
         uid = uuid.uuid4()
         if persons_size != 0:
             uid = persons[i].uuid
             i = (i + 1) % persons_size
         self.notify_trame(uid)
         print('personne index', i)
     pass
Example #3
0
 def get(self, user_id):
     print('GET Person', user_id)
     task = TaskGetPersonne(id=user_id)
     result = {'success': True, 'result': task.execute()}
     print('task Finish')
     return json.dumps(result, indent=4, sort_keys=True, cls=new_alchemy_encoder_v2(False, ['promotion']), check_circular=False)