def sigtransform(*Models):
    import django
    from django.shortcuts import get_object_or_404
    def _decorator(func):
        def _closure(request, *args, **kwargs):
            args = list(args)
            for ii, Model_and_cleaner in enumerate(Models):
                # None is passed to @sigtransform to indicate "leave
                # this argument alone"
                if Model_and_cleaner is None:
                    pass
                else:
                    Model, cleaner = Model_and_cleaner
                    # pk arg needs correct datatype, hence cleaner func. 
                    args[ii] = get_object_or_404(Model, pk=cleaner(args[ii]))
            return func(request, *args, **kwargs)
        _closure.__name__ = func.__name__
        _closure.__doc___ = func.__doc__
        _closure.__module___ = func.__module__
        return _closure
    return _decorator