@classmethod
def extract_api_viewset(mcs, attrs):
    """
        Extracts APIFiltering specification from the attributes.

        :param attrs: Model class attributes
        :return: APIFiltering class.
        """
    spec = attrs.pop('APIViewset')
    for attr, default in mcs.API_VIEWSET_ATTRS:
        if not hasattr(spec, attr):
            setattr(spec, attr, default())
    return spec
