Ticket #3828: 4828-fix-request-access.diff
File 4828-fix-request-access.diff, 851 bytes (added by , 18 years ago) |
---|
-
django/core/context_processors.py
42 42 43 43 return context_extras 44 44 45 class TemplateRequestWrapper(object): 46 def __init__(self, request): 47 self._request = request 48 def __repr__(self): 49 return self._request.__repr__() 50 def __getitem__(self, name): 51 # __getitem__ is used for optimization 52 # (thats what the resolver tries first) 53 return getattr(self._request, name) 54 45 55 def request(request): 46 return {'request': request}56 return {'request': TemplateRequestWrapper(request)} 47 57 48 58 # PermWrapper and PermLookupDict proxy the permissions system into objects that 49 59 # the template system can understand.