Re: problems with request.user

2008-08-28 Thread Peter of the Norse
In the docs for get_or_create()[1], it states that any argument given with `__` is stripped for the create() call. The reasons for this should be obvious. Thus, your original code was trying to save an empty Rating. As for speed, the new version has less SQL. `user__pk` creates a join and

Re: problems with request.user

2008-08-21 Thread Burr Settles
When the IntegrityError is thrown, the debug package stated that "songs_rating.user_id may not be NULL". It is indeed being thrown by get_or_create(). Strangely enough, request.user.id contains the correct value of the logged in user's ID, so I don't know what the problem is. I did manage to get t

Re: problems with request.user

2008-08-21 Thread Genis Pujol Hamelink
Hello, I think it's with request.session['_auth_user_id'], but not sure gr, G. On Wed, Aug 20, 2008 at 11:13 PM, Burr Settles <[EMAIL PROTECTED]>wrote: > > I recently came back to a project I put on hold for a couple weeks, > and after updating the Django trunk, all my references to > "r

Re: problems with request.user

2008-08-20 Thread Karen Tracey
On Wed, Aug 20, 2008 at 5:13 PM, Burr Settles <[EMAIL PROTECTED]> wrote: > > I recently came back to a project I put on hold for a couple weeks, > and after updating the Django trunk, all my references to > "request.user.id" are broken. Here is an example view for a rating > widget: > > 1 @login_r

problems with request.user

2008-08-20 Thread Burr Settles
I recently came back to a project I put on hold for a couple weeks, and after updating the Django trunk, all my references to "request.user.id" are broken. Here is an example view for a rating widget: 1 @login_required 2 def rate(request, song_id): 3 song = get_object_or_404(Song, pk=song_id)