def related_field_factory(model_class, queryset=None):
    """
    Returns a subclass of `RelatedField` for each model_class in the registry
    """
    if queryset is None:
        queryset = model_class.objects.all()
    related_field_class = serializers.PrimaryKeyRelatedField
    kwargs = {'queryset': queryset}
    if DRF_SETTINGS['HYPERLINK_FIELDS']:
        related_field_class = serializers.HyperlinkedRelatedField
        kwargs['view_name'] = f'{label(model_class)}-detail'
    elif DRF_SETTINGS['EXPAND_FIELDS']:
        related_field_class = ExpandRelatedField
    field = type(f'{model_class.__name__}RelatedField', (related_field_class,), {})
    return field(**kwargs)

    Returns a subclass of `RelatedField` for each model_class in the registry
    
actstream/drf/serializers.py