Or ignore the form username field;
author=request.user
Sachin Ranadive
On Thu, Mar 5, 2020, 8:17 PM Sachin Ranadive
wrote:
> Change view code, assign User object instead.
>
> author = User.objects.get(username=request.POST["username"])
>
> Sachin
>
> On Thu, Mar 5, 2020, 4:00 AM Joey Jo Jo Jr
Change view code, assign User object instead.
author = User.objects.get(username=request.POST["username"])
Sachin
On Thu, Mar 5, 2020, 4:00 AM Joey Jo Jo Jr wrote:
> New to Django.
>
> I'm trying to set up a simple comment form where I can add a title for the
> comment, content of the comment,
New to Django.
I'm trying to set up a simple comment form where I can add a title for the
comment, content of the comment, and attach the username of the user that
is currently signed in and posting it.
I run into the following error when running it:
Cannot assign "'john'": "Entry.author" must
3 matches
Mail list logo