def resource_response(resource, depth=0):
    """Return a response for the *resource* of the appropriate content type.

    :param resource: resource to be returned in request
    :type resource: :class:`sandman.model.Model`
    :rtype: :class:`flask.Response`

    """
    if _get_acceptable_response_type() == JSON:
        depth = 0
        if 'expand' in request.args:
            depth = 1
        return _single_resource_json_response(resource, depth)
    else:
        return _single_resource_html_response(resource)
def resource_response ( resource , depth = 0 ) : if _get_acceptable_response_type ( ) == JSON : depth = 0 if 'expand' in request . args : depth = 1 return _single_resource_json_response ( resource , depth ) else : return _single_resource_html_response ( resource )
Return a response for the *resource* of the appropriate content type.

    :param resource: resource to be returned in request
    :type resource: :class:`sandman.model.Model`
    :rtype: :class:`flask.Response`