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)
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))
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))