#NEWLINE# def api_redirect( request , base_view = None , obj_id = None ) : #NEWLINE# #INDENT# "\n    When '.json' is appended to a citation or authority URL, it should redirect\n    to the REST API view for that resource.\n\n    TODO: implement redirect for search results.\n    " #NEWLINE# view_name = '{model}-detail' . format ( model = base_view ) #NEWLINE# rest_view = reverse ( view_name , args = [ obj_id ] , request = request ) #NEWLINE# return HttpResponseRedirect ( rest_view )