From c93965bbefc9d6bceb49f85dd3214ae7544d4b37 Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Fri, 6 Jan 2006 21:07:15 +0000 Subject: [PATCH] magic-removal: updated session docs to reflect move of sessions to django.contrib.sessions. git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1838 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/sessions.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/sessions.txt b/docs/sessions.txt index fbb11e4198..0d8b27b107 100644 --- a/docs/sessions.txt +++ b/docs/sessions.txt @@ -16,11 +16,6 @@ You can turn session functionality on and off by editing the ``MIDDLEWARE_CLASSES`` setting. To activate sessions, make sure ``MIDDLEWARE_CLASSES`` contains ``"django.middleware.sessions.SessionMiddleware"``. -If you're dealing with an admin site, make sure the ``SessionMiddleware`` line -appears before the ``AdminUserRequired`` line. (The middleware classes are -applied in order, and the admin middleware requires that the session middleware -come first.) - If you don't want to use sessions, you might as well remove the ``SessionMiddleware`` line from ``MIDDLEWARE_CLASSES``. It'll save you a small bit of overhead. @@ -146,11 +141,11 @@ Using sessions out of views =========================== Internally, each session is just a normal Django model. The ``Session`` model -is defined in ``django/models/core.py``. Because it's a normal model, you can -access sessions using the normal Django database API:: +is defined in ``django/contrib/sessions/models.py``. Because it's a normal +model, you can access sessions using the normal Django database API:: - >>> from django.models.core import sessions - >>> s = sessions.get_object(pk='2b1189a188b44ad18c35e113ac6ceead') + >>> from django.contrib.sessions.models import Session + >>> s = Session.objects.get_object(pk='2b1189a188b44ad18c35e113ac6ceead') >>> s.expire_date datetime.datetime(2005, 8, 20, 13, 35, 12)