Re: Problem with get_current_user via middleware - SOLVED

2007-03-27 Thread Gilhad
> > As I did some other experiments, it seems to me, that there are > > TWO '_thread_locals' objects, one filled in 'process_request' (which > > has 'user' attribute set) and another one in 'get_current_user' which > > does not. The problem was in the fact, that i had import middleware.threadloc

Re: Problem with get_current_user via middleware

2007-03-27 Thread Gilhad
On Tuesday 27 March 2007 10:28, Gilhad wrote: > > the default value is a callable, its not a value... I use exactly this > > and it work very well for me... > > I agree that there is duplicity (why specify a default if you override > > it in save() ), but that shouldn't matter > > The idea is, tha

Re: Problem with get_current_user via middleware

2007-03-27 Thread Gilhad
> > the default value is a callable, its not a value... I use exactly this > and it work very well for me... > I agree that there is duplicity (why specify a default if you override > it in save() ), but that shouldn't matter The idea is, that new object 'Vykon' came prefilled, but in the admin

Re: Problem with get_current_user via middleware

2007-03-26 Thread Malcolm Tredinnick
On Tue, 2007-03-27 at 02:52 +0200, Honza Král wrote: > On 3/27/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Mon, 2007-03-26 at 21:56 +0200, Gilhad wrote: > > > I am trying to get current user, but I have some problem with it. I got > > > different '_local' object each time ... > >

Re: Problem with get_current_user via middleware

2007-03-26 Thread Honza Král
On 3/27/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Mon, 2007-03-26 at 21:56 +0200, Gilhad wrote: > > I am trying to get current user, but I have some problem with it. I got > > different '_local' object each time ... > > > > I followed the example at > > http://code.djangoproject.com/

Re: Problem with get_current_user via middleware

2007-03-26 Thread Malcolm Tredinnick
On Mon, 2007-03-26 at 21:56 +0200, Gilhad wrote: > I am trying to get current user, but I have some problem with it. I got > different '_local' object each time ... > > I followed the example at > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > and make my model such way: >

Re: Problem with get_current_user via middleware

2007-03-26 Thread Honza Král
On 3/26/07, Gilhad <[EMAIL PROTECTED]> wrote: > > I am trying to get current user, but I have some problem with it. I got > different '_local' object each time ... > > I followed the example at > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > and make my model such way: > > clas

Problem with get_current_user via middleware

2007-03-26 Thread Gilhad
I am trying to get current user, but I have some problem with it. I got different '_local' object each time ... I followed the example at http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser and make my model such way: class Vykon(models.Model): user = models.ForeignKey(User