Re: Using auth in model

2007-11-10 Thread Matthias Urlichs
Hi, On Nov 10, 3:18 am, Arnold Chen <[EMAIL PROTECTED]> wrote: > Sorry, there is a typo mistake, my question is "how to get logged-in" > user WITHOUT request parameter. > Because i want to use it in a function in models.py There is a clean separation of "what data do you have" and "what data can

Re: Using auth in model

2007-11-09 Thread James Bennett
On Nov 9, 2007 8:18 PM, Arnold Chen <[EMAIL PROTECTED]> wrote: > Sorry, there is a typo mistake, my question is "how to get logged-in" > user WITHOUT request parameter. > Because i want to use it in a function in models.py This is not possible. The logged-in user is an attribute of an HTTP reques

Re: Using auth in model

2007-11-09 Thread Arnold Chen
Sorry, there is a typo mistake, my question is "how to get logged-in" user WITHOUT request parameter. Because i want to use it in a function in models.py regards, Arnold On 11月8日, 下午8時18分, Dan Fairs <[EMAIL PROTECTED]> wrote: > > My question above can be simplified as "how to get logged-in user

Re: Using auth in model

2007-11-08 Thread Dan Fairs
> > My question above can be simplified as "how to get logged-in user with > request parameter" request.user will give you the logged-in user. If you want to know more about Django profile support, read the docs: http://www.djangobook.com/en/beta/chapter12/ You want the profiles section,

Re: Using auth in model

2007-11-07 Thread Arnold Chen
My question above can be simplified as "how to get logged-in user with request parameter" On Nov 8, 12:32 pm, Arnold Chen <[EMAIL PROTECTED]> wrote: > I want to let users to create their own profile in django admin. And > when they save any new records, use their logged-in user id > (models.Forei

Using auth in model

2007-11-07 Thread Arnold Chen
I want to let users to create their own profile in django admin. And when they save any new records, use their logged-in user id (models.ForeignKey(User)) and override the save() function of the model. Is there any statement that i can use? i believe it should be something like auth.user thanks