Django

Code

Changeset 1951

Show
Ignore:
Timestamp:
01/13/06 12:27:40 (3 years ago)
Author:
jkocherhans
Message:

magic-removal: Updated docs to reflect move/rename of DjangoContext?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/docs/authentication.txt

    r1916 r1951  
    436436 
    437437The currently logged-in user and his/her permissions are made available in the 
    438 `template context`_ when you use ``DjangoContext``. 
     438`template context`_ when you use ``RequestContext``. 
    439439 
    440440.. admonition:: Technicality 
    441441 
    442442   Technically, these variables are only made available in the template context 
    443    if you use ``DjangoContext`` *and* your ``TEMPLATE_CONTEXT_PROCESSORS`` 
     443   if you use ``RequestContext`` *and* your ``TEMPLATE_CONTEXT_PROCESSORS`` 
    444444   setting contains ``"django.core.context_processors.auth"``, which is default. 
    445    For more, see the `DjangoContext docs`_. 
    446  
    447    .. _DjangoContext docs: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
     445   For more, see the `RequestContext docs`_. 
     446 
     447   .. _RequestContext docs: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
    448448 
    449449Users 
     
    534534        # ... 
    535535        request.user.add_message("Your playlist was added successfully.") 
    536         return render_to_response("playlists/create", context_instance=DjangoContext(request)) 
    537  
    538 When you use ``DjangoContext``, the currently logged-in user and his/her 
     536        return render_to_response("playlists/create", context_instance=RequestContext(request)) 
     537 
     538When you use ``RequestContext``, the currently logged-in user and his/her 
    539539messages are made available in the `template context`_ as the template variable 
    540540``{{ messages }}``. Here's an example of template code that displays messages:: 
     
    548548    {% endif %} 
    549549 
    550 Note that ``DjangoContext`` calls ``get_and_delete_messages`` behind the 
     550Note that ``RequestContext`` calls ``get_and_delete_messages`` behind the 
    551551scenes, so any messages will be deleted even if you don't display them. 
    552552 
  • django/branches/magic-removal/docs/flatpages.txt

    r1166 r1951  
    5050      it loads the template ``flatpages/default``. 
    5151    * It passes that template a single context variable, ``flatpage``, which is 
    52       the flatpage object. It uses DjangoContext_ in rendering the template. 
     52      the flatpage object. It uses RequestContext_ in rendering the template. 
    5353 
    5454If it doesn't find a match, the request continues to be processed as usual. 
     
    6464 
    6565.. _SITE_ID: http://www.djangoproject.com/documentation/settings/#site-id 
    66 .. _DjangoContext: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
     66.. _RequestContext: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
    6767.. _middleware docs: http://www.djangoproject.com/documentation/middleware/ 
    6868 
  • django/branches/magic-removal/docs/generic_views.txt

    r1933 r1951  
    122122 
    123123    ``processors``           A tuple of processors to apply to the 
    124                              ``DjangoContext`` of this view's template. See the 
    125                              `DjangoContext docs`_ 
     124                             ``RequestContext`` of this view's template. See the 
     125                             `RequestContext docs`_ 
    126126    =======================  ================================================== 
    127127 
    128128.. _database API docs: http://www.djangoproject.com/documentation/db_api/ 
    129 .. _DjangoContext docs: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
     129.. _RequestContext docs: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
    130130 
    131131The date-based generic functions are: 
    132132 
    133 ``archive_index`` 
     133``archive_index``RequestContext 
    134134    A top-level index page showing the "latest" objects. 
    135135 
  • django/branches/magic-removal/docs/i18n.txt

    r1936 r1951  
    225225``gettext`` / ``ngettext`` call. 
    226226 
    227 Each ``DjangoContext`` has access to two translation-specific variables: 
     227Each ``RequestContext`` has access to two translation-specific variables: 
    228228 
    229229    * ``LANGUAGES`` is a list of tuples in which the first element is the 
     
    232232      Example: ``en-us``. (See "How language preference is discovered", below.) 
    233233 
    234 If you don't use the ``DjangoContext`` extension, you can get those values with 
     234If you don't use the ``RequestContext`` extension, you can get those values with 
    235235two tags:: 
    236236 
  • django/branches/magic-removal/docs/settings.txt

    r1936 r1951  
    464464Default:: 
    465465 
    466     ("django.contrib.sessions.middleware.SessionMiddleware", 
     466    ("django.middleware.sessions.SessionMiddleware", 
    467467     "django.middleware.common.CommonMiddleware", 
    468468     "django.middleware.doc.XViewMiddleware") 
     
    556556    "django.core.context_processors.i18n") 
    557557 
    558 A tuple of callables that are used to populate the context in ``DjangoContext``. 
     558A tuple of callables that are used to populate the context in ``RequestContext``. 
    559559These callables take a request object as their argument and return a dictionary 
    560560of items to be merged into the context. 
     
    596596---------------- 
    597597 
    598 Default: ``('django.core.template.loaders.filesystem.load_template_source',)`` 
     598Default: ``('django.template.loaders.filesystem.load_template_source',)`` 
    599599 
    600600A tuple of callables (as strings) that know how to import templates from 
  • django/branches/magic-removal/docs/templates_python.txt

    r1948 r1951  
    242242you'll see below. 
    243243 
    244 Subclassing Context: DjangoContext 
     244Subclassing Context: RequestContext 
    245245---------------------------------- 
    246246 
    247247Django comes with a special ``Context`` class, 
    248 ``django.core.extensions.DjangoContext``, that acts slightly differently than 
     248``django.template.RequestContext``, that acts slightly differently than 
    249249the normal ``django.template.Context``. The first difference is that takes 
    250250an `HttpRequest object`_ as its first argument. For example:: 
    251251 
    252     c = DjangoContext(request, { 
     252    c = RequestContext(request, { 
    253253        'foo': 'bar', 
    254254    } 
     
    270270below. 
    271271 
    272 Also, you can give ``DjangoContext`` a list of additional processors, using the 
     272Also, you can give ``RequestContext`` a list of additional processors, using the 
    273273optional, third positional argument, ``processors``. In this example, the 
    274 ``DjangoContext`` instance gets a ``ip_address`` variable:: 
     274``RequestContext`` instance gets a ``ip_address`` variable:: 
    275275 
    276276    def ip_address_processor(request): 
     
    279279    def some_view(request): 
    280280        # ... 
    281         return DjangoContext({ 
     281        return RequestContext({ 
    282282            'foo': 'bar', 
    283283        }, [ip_address_processor]) 
     
    292292 
    293293If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every 
    294 ``DjangoContext`` will contain these three variables: 
     294``RequestContext`` will contain these three variables: 
    295295 
    296296    * ``user`` -- An ``auth.User`` instance representing the currently 
     
    310310 
    311311If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every 
    312 ``DjangoContext`` will contain these two variables -- but only if your 
     312``RequestContext`` will contain these two variables -- but only if your 
    313313``DEBUG`` setting is set to ``True`` and the request's IP address 
    314314(``request.META['REMOTE_ADDR']``) is in the ``INTERNAL_IPS`` setting: 
     
    324324 
    325325If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every 
    326 ``DjangoContext`` will contain these two variables: 
     326``RequestContext`` will contain these two variables: 
    327327 
    328328    * ``LANGUAGES`` -- The value of the `LANGUAGES setting`_.