Exemplo n.º 1
0
def validate(validation_class, fill_out_args=True, allow_extra_fields=True, **kwargs):
    
    args = kwargs
    if fill_out_args:
        
        def get_val(kw, f):
            if f in kwargs: return kwargs[f]
            return ''
        
        args = dict([(f, get_val(kwargs, f)) for f in validation_class.fields.keys()])
    
    params = validation_class(allow_extra_fields=allow_extra_fields).to_python(args)
    
    params = dict([(k, params[k]) for k in params.keys() if k in kwargs and validation_class.fields])
    
    return objectify(params)
Exemplo n.º 2
0
def unjsonify(response, do_objectify=True):
    """
    Takes the response from a client_async-decorated action
    and returns a python object derived from it.
    """
    return objectify(json.loads(response.body))
Exemplo n.º 3
0
 def _unjsonify(self, response):
     """
     Takes the response from a client_async-decorated action
     and returns a python object derived from it.
     """
     return objectify(json.loads(response))
Exemplo n.º 4
0
 def _unjsonify(self, response):
     """
     Takes the response from a client_async-decorated action
     and returns a python object derived from it.
     """
     return objectify(json.loads(response))
Exemplo n.º 5
0
def unjsonify(response, do_objectify=True):
    """
    Takes the response from a client_async-decorated action
    and returns a python object derived from it.
    """
    return objectify(json.loads(response.body))