obj.user_id = request.user.id # this is too
really?
On 7 янв, 12:55, Collin Grady <[EMAIL PROTECTED]> wrote:
> On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote:
>
> > When I used request.user, it outputs the username of the currently
> > logged in user. When I try and use this as part of
On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote:
> When I used request.user, it outputs the username of the currently
> logged in user. When I try and use this as part of the entry into the
> table, it won't let me as it's expecting an integer.
You are mistaken. When /printing/ the user o
The error message:
Invalid value: 'user' should be a instance, not a
clearly states you should use a User-instance and not an integer
(long).
You might wanna show us some code...
And yes printing request.user reuturns the username, but that's caused
by __unicode__ and has nothing to to with th
When I used request.user, it outputs the username of the currently
logged in user. When I try and use this as part of the entry into the
table, it won't let me as it's expecting an integer.
Is that wrong?
On Jan 6, 9:33 pm, Florian Apolloner <[EMAIL PROTECTED]> wrote:
> You are doing something l
You are doing something like my_instance.author = request.user.id
whereas you should do: my_instance.author = request.user. Why? You are
working with the Django ORM and it doesn't expect you to give it an
User-Id (although it get's saved as that in the db), but an instance
of django.contrib.auth.m
Thanks, should have guessed that!
For some reason though it is returning the value as 11L. I just want
it to return 11, as it is throwing up an error when trying to use it
like that:
Invalid value: 'user' should be a instance, not a
I'm using a MySQL database, any way of stripping the L off t
User id - request.user.id
On 6 янв, 23:43, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> Been looking to get the current id of the user logged in everywhere
> but can't seem to find how to do this.
>
> Basically in my views.py file I want to insert an entry into a table.
> Part of this ins
7 matches
Mail list logo