def device(view):
    def _decorator(request, *args, **kwargs):
        if not hasattr(request, "device"):
            m = DeviceMiddleware()
            m.process_request(request)
        return view(request, *args, **kwargs)

    _decorator.__doc__ = view.__doc__
    _decorator.__name__ = view.__name__

    return _decorator
Modifies the `request` object, adding the detected
dataset/ETHPy150Open clement/django-wurfl/wurfl/decorators.py/device