Reputation: 1203
new_todo = Todo(text=request.POST['text'],instance.User=request.user)
SyntaxError: keyword can't be an expression
What exactly went wrong here?
I just want the user who created the todo his name should be automatically relfected to the database.....So, I have done this in my create view...
Upvotes: 0
Views: 313
Reputation: 29099
You problem is instance.User=...
. The left part (that's what keyword mean in this context) should be one of the variable names that ToDo
constructor accepts.
Also, it's not django-specific, it's general python.
Upvotes: 2