From 46083845d4125ea6c7da66b81cd8bdd9ec6ac067 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 13 Nov 2005 04:43:07 +0000 Subject: [PATCH] Changed slightly misleading example in docs/sessions.txt to use baggage-less 'members' instead of 'users' git-svn-id: http://code.djangoproject.com/svn/django/trunk@1211 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/sessions.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/sessions.txt b/docs/sessions.txt index 8aa711ea23..a070eda2dd 100644 --- a/docs/sessions.txt +++ b/docs/sessions.txt @@ -92,21 +92,21 @@ posts a comment. It doesn't let a user post a comment more than once:: request.session['has_commented'] = True return HttpResponse('Thanks for your comment!') -This simplistic view logs a user in:: +This simplistic view logs in a "member" of the site:: def login(request): - u = users.get_object(username__exact=request.POST['username']) - if u.check_password(request.POST['password']): - request.session['user_id'] = u.id + m = members.get_object(username__exact=request.POST['username']) + if m.password == request.POST['password']: + request.session['member_id'] = m.id return HttpResponse("You're logged in.") else: return HttpResponse("Your username and password didn't match.") -...And this one logs a user out, according to ``login()`` above:: +...And this one logs a member out, according to ``login()`` above:: def logout(request): try: - del request.session['user_id'] + del request.session['member_id'] except KeyError: pass return HttpResponse("You're logged out.")