Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-29 Thread pk
There are two issues. 1) you can't change the auth_user table/class. There are different ways to "extend" the auth_user class. The "B-List" site has some article on how you may do it. http://www.b-list.org/ I have my own "user" class that is one-to-one implemented as "many-to- one" back to the a

Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-26 Thread Greg
Ok...I'm looking into using django's builtin Authentication models. I can use that to add users. However, I still need to associate a user with their favorites once they login. So do I need to add a ManyToManyField in my User table that points to my products table? On Nov 26, 6:51 pm, pk <[EMA

Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-26 Thread pk
There are a couple of things you have to do to get the "user" object automatically available to all templates. 1. Follow the authentication setup as suggested. 2. Then read the bit about request_context: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestconte

Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-26 Thread Christopher Allan Webber
Why not use django's builtin Authentication models? It handles most of this for you. from django.contrib import auth authenticate with: user = auth.authenticate(username=username, password=password) then log the user in: auth.login(request, user) and prest

How to display if a user is logged in? Do I develop a custom template tag?

2007-11-26 Thread Greg
Hello, I have a website where people can login and keep track of their favorite products. Whenever they login I create a session variable: 'request.session['member_id']'. If this session variable is set then I know that a user is logged in. In order to get this to work I have to send the sessio