I'm trying to encapsulate an object without changing it's default behavior, the problem is that by the time I get access to the object it's already constructed. As such, my idea is to use inheritance and use `__getattr__`, `__setattr__`, `__getitem__`, and `__setitem__` and delegate to the encapsulated object, except for fields I define myself.

```
class Request(HttpRequest):

    def __init__(self, request, *args, **kwargs):
        self._original_request = request
        super(Request, self).__init__(*args, **kwargs)

    def __getattr__(self, name):
        return getattr(self._original_request, name)

    def __setattr__(self, name, value):
        if name == '_original_request':
            super(Request, self).__setattr__(name, value)
        else:
            self._original_request.__setattr__(name, value)

    def __getitem__(self, key):
        return self._original_request[key]

    def __setitem__(self, key, value):
        self._original_request[key] = value

```

If I pass along the original object, everything is fine. If I don't, I get

```
host = self.META['SERVER_NAME']
KeyError: u'SERVER_NAME'

```

Am I missing something? Shouldn't my class behave exactly that the one it encapsulates?

```
Internal Server Error: /
Traceback (most recent call last):
  File "c:\Python27\lib\site-packages\django\core\handlers\base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "c:\Python27\lib\site-packages\django\views\generic\base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\www\lookwanted\djutils\views.py", line 35, in dispatch
    return super(View, self).dispatch(Request(request), *args, **kwargs)
  File "C:\www\lookwanted\djutils\views.py", line 12, in __init__
    super(Request, self).__init__(*args, **kwargs)
  File "c:\Python27\lib\site-packages\django\http\request.py", line 43, in __init__
    self.GET, self.POST, self.COOKIES, self.META, self.FILES = {}, {}, {}, {}, {}
  File "C:\www\lookwanted\djutils\views.py", line 21, in __setattr__
    self._original_request.__setattr__(name, value)
AttributeError: can't set attribute
Traceback (most recent call last):
  File "c:\Python27\lib\wsgiref\handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "c:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 72, in __call__
    return self.application(environ, start_response)
  File "c:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 255, in __call__
    response = self.get_response(request)
  File "c:\Python27\lib\site-packages\django\core\handlers\base.py", line 178, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "c:\Python27\lib\site-packages\django\core\handlers\base.py", line 217, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "c:\Python27\lib\site-packages\django\views\debug.py", line 69, in technical_500_response
    html = reporter.get_traceback_html()
  File "c:\Python27\lib\site-packages\django\views\debug.py", line 298, in get_traceback_html
    return t.render(c)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 140, in render
    return self._render(context)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 134, in _render
    return self.nodelist.render(context)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 830, in render
    bit = self.render_node(node, context)
  File "c:\Python27\lib\site-packages\django\template\debug.py", line 74, in render_node
    return node.render(context)
  File "c:\Python27\lib\site-packages\django\template\defaulttags.py", line 284, in render
    return nodelist.render(context)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 830, in render
    bit = self.render_node(node, context)
  File "c:\Python27\lib\site-packages\django\template\debug.py", line 74, in render_node
    return node.render(context)
  File "c:\Python27\lib\site-packages\django\template\debug.py", line 84, in render
    output = self.filter_expression.resolve(context)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 578, in resolve
    obj = self.var.resolve(context)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 728, in resolve
    value = self._resolve_lookup(context)
  File "c:\Python27\lib\site-packages\django\template\base.py", line 779, in _resolve_lookup
    current = current()
  File "c:\Python27\lib\site-packages\django\http\request.py", line 112, in build_absolute_uri
    self.get_host(), self.path)
  File "c:\Python27\lib\site-packages\django\http\request.py", line 62, in get_host
    host = self.META['SERVER_NAME']
KeyError: u'SERVER_NAME'

```