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
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
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
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
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)
5 matches
Mail list logo