def get_queryset(klass, index, filter="pk"):
    
    def wrapper(*args, **kwargs):
        if type(index) == int:
            arg = args[index]
        else:
            arg = kwargs[index]
        return klass.objects.filter(**{filter: arg})
    
    return wrapper
Returns a function that can be used for the require_*_permission_for_view
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/permissions/utils.py/get_queryset