Django

Code

Changeset 2133

Show
Ignore:
Timestamp:
01/27/06 09:55:04 (3 years ago)
Author:
adrian
Message:

Fixed #1271 -- Added a 'request' template context processor, which is not activated by default.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r1931 r2133  
    111111    'django.core.context_processors.debug', 
    112112    'django.core.context_processors.i18n', 
     113#    'django.core.context_processors.request', 
    113114) 
    114115 
  • django/trunk/django/core/context_processors.py

    r1774 r2133  
    3939    return context_extras 
    4040 
     41def request(request): 
     42    return {'request': request} 
     43 
    4144# PermWrapper and PermLookupDict proxy the permissions system into objects that 
    4245# the template system can understand. 
  • django/trunk/docs/templates_python.txt

    r2077 r2133  
    330330.. _internationalization docs: http://www.djangoproject.com/documentation/i18n/ 
    331331 
     332django.core.context_processors.request 
     333~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     334 
     335**New in Django development version** 
     336 
     337If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every 
     338``DjangoContext`` will contain a variable ``request``, which is the current 
     339`HttpRequest object`_. Note that this processor is not enabled by default; 
     340you'll have to activate it. 
     341 
    332342Loading templates 
    333343-----------------