From 7aa84917a4ae8ca380fea1ae1937706d367389ed Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 23 Feb 2011 13:36:58 +0000 Subject: Fixed #15299 -- Started the process of migrating the auth context processor support classes into the auth context processor module. Thanks to shailesh for the report, and v1v3kn for the draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15635 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/internals/deprecation.txt | 10 ++++++++-- docs/ref/templates/api.txt | 7 ++++++- docs/releases/1.3.txt | 12 ++++++++++++ docs/topics/auth.txt | 10 +++++++--- 4 files changed, 33 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 9bb0289c68..de62dc025e 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -151,13 +151,19 @@ their deprecation, as per the :ref:`Django deprecation policy The ``supports_inactive_user`` variable is not checked any longer and can be removed. - * :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise - a :class:`~django.contrib.gis.geos.GEOSException` when called + * :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise + a :class:`~django.contrib.gis.geos.GEOSException` when called on a geometry with no SRID value. * :class:`~django.http.CompatCookie` will be removed in favour of :class:`~django.http.SimpleCookie`. + * :class:`django.core.context_processors.PermWrapper` and + :class:`django.core.context_processors.PermLookupDict` + will be moved to :class:`django.contrib.auth.context_processors.PermWrapper` + and :class:`django.contrib.auth.context_processors.PermLookupDict`, + respectively. + * 2.0 * ``django.views.defaults.shortcut()``. This function has been moved to ``django.contrib.contenttypes.views.shortcut()`` as part of the diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 71fcbd9f56..ba78f15e81 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -423,7 +423,7 @@ If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every via the :doc:`messages framework `. * ``perms`` -- An instance of - ``django.core.context_processors.PermWrapper``, representing the + ``django.contrib.auth.context_processors.PermWrapper``, representing the permissions that the currently logged-in user has. .. versionchanged:: 1.2 @@ -435,6 +435,11 @@ If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every ``user.get_and_delete_messages()``. It has been changed to include any messages added via the :doc:`messages framework `. +.. versionchanged:: 1.3 + Prior to version 1.3, ``PermWrapper`` was located in + ``django.contrib.auth.context_processors``. + + django.core.context_processors.debug ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt index 887943aec8..29e4fd46f5 100644 --- a/docs/releases/1.3.txt +++ b/docs/releases/1.3.txt @@ -828,3 +828,15 @@ Rationale for this decision: * This location wasn't included in the translation building process for JavaScript literals. + +``PermWrapper`` moved to ``django.contrib.auth.context_processors`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In Django 1.2, we began the process of changing the location of the +``auth`` context processor from ``django.core.context_processors`` to +``django.contrib.auth.context_processors``. However, the +``PermWrapper`` support class was mistakenly omitted from that +migration. In Django 1.3, the ``PermWrapper`` class has also been +moved to ``django.contrib.auth.context_processors``, along with the +``PermLookupDict`` support class. The new classes are functionally +identical to their old versions; only the module location has changed. diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt index 6c758d984e..52ddf22e7b 100644 --- a/docs/topics/auth.txt +++ b/docs/topics/auth.txt @@ -661,7 +661,7 @@ How to log a user out Login and logout signals ------------------------ -.. versionadded:: 1.3 +.. versionadded:: 1.3 The auth framework uses two :doc:`signals ` that can be used for notification when a user logs in or out. @@ -949,7 +949,7 @@ includes a few other useful built-in views located in Allows a user to reset their password by generating a one-time use link that can be used to reset the password, and sending that link to the user's registered e-mail address. - + .. versionchanged:: 1.3 The ``from_email`` argument was added. @@ -1334,9 +1334,13 @@ Permissions The currently logged-in user's permissions are stored in the template variable ``{{ perms }}``. This is an instance of -:class:`django.core.context_processors.PermWrapper`, which is a +:class:`django.contrib.auth.context_processors.PermWrapper`, which is a template-friendly proxy of permissions. +.. versionchanged:: 1.3 + Prior to version 1.3, ``PermWrapper`` was located in + ``django.contrib.auth.context_processors``. + In the ``{{ perms }}`` object, single-attribute lookup is a proxy to :meth:`User.has_module_perms `. This example would display ``True`` if the logged-in user had any permissions -- cgit v1.3