Example #1
0
 def __init__(self, status=True, payload=None):
     ret = {}
     if status is False:
         ret['status'] = 'error'
     else:
         ret['status'] = 'success'
     ret['payload'] = payload
     JsonResponse.__init__(self, data=ret, safe=False)
Example #2
0
 def __init__(self,
              sequencing_job_id,
              status,
              completion_status,
              error_message=None,
              output_files=None,
              attributes=None,
              callback=None):
     JsonResponse.__init__(
         self, {
             'sequencingJobId': sequencing_job_id,
             'status': status,
             'completionStatus': completion_status,
             'errorMessage': error_message,
             'outputFiles': output_files,
             'attributes': attributes,
             'callback': callback
         })
Example #3
0
 def __init__(self, data, **kwargs):
     kwargs.setdefault('encoder', JSONEncoder)
     BaseJsonResponse.__init__(self, data, **kwargs)
 def __init__(self, err, msg, status_code = 400):
     Exception.__init__(self, '{}: {}'.format(err, msg))
     JsonResponse.__init__(self, {'err':err, 'msg':msg})
     self.err = err
     self.status_code = status_code
Example #5
0
 def __init__(self, json, status_code=StatusType.SUCCESS, **kwargs):
     response = {"data": json}
     JsonResponse.__init__(self,
                           response,
                           status=status_code.value,
                           **kwargs)
Example #6
0
 def __init__(self, authentication_token):
     JsonResponse.__init__(
         self, {'authenticationToken': str(authentication_token)})
Example #7
0
 def __init__(self, error):
     JsonResponse.__init__(self, {'status': 1, 'error': error})
Example #8
0
 def __init__(self):
     JsonResponse.__init__(self, {'status': 0})