def compose_views(request, user_profile, method_kwarg_pairs):
 json_dict = {}
 with transaction.atomic():
  for (method, kwargs) in method_kwarg_pairs:
   response = method(request, user_profile, **kwargs)
   if (response.status_code != 200):
    raise JsonableError(response.content)
   json_dict.update(ujson.loads(response.content))
 return json_success(json_dict)

def compose_views ( request , user_profile , method_kwarg_pairs ) : json_dict = { } with transaction . atomic ( ) : for ( method , kwargs ) in method_kwarg_pairs : response = method ( request , user_profile , ** kwargs ) if ( response . status_code != 200 ) : raise JsonableError ( response . content ) json_dict . update ( ujson . loads ( response . content ) ) return json_success ( json_dict )
this takes a series of view methods from method_kwarg_pairs and calls them in sequence .