我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用rest_framework.viewsets.ViewSetMixin()。
def get_view_introspector(api): """ Creates view introspector based on api :param api: :rtype: BaseViewIntrospector """ callback = api['callback'] def inmodule(callback, module_name): return callback.__module__ == module_name map = ( (issubclass, ViewSetMixin, ViewSetIntrospector), (inmodule, 'rest_framework.decorators', WrappedApiViewIntrospector), (issubclass, APIView, ApiViewIntrospector), ) for f, param, introspector_class in map: if f(callback, param): return introspector_class(**api) raise IntrospectorException('View introspector not recognized')