My previous mex got with wrong identation: the last 4 lines need to
start at the same level:
if request.method == 'POST':
form = GoalForm(request.POST)
if form.is_valid():
goal=form.save(commit=False)
goal.user=request.user
goal.save()
form.save_m2m()
--
You received this messag
On 7 Feb, 22:26, kamilski81 wrote:
> I am trying to set a user on a model, on the back-end.
>
> u = request.user
> g = Goal()
> g.user = u
> form = GoalForm(request.POST, g)
>
> I am getting the following error:
> goal.user_id may not be NULL
hello
you can try wit
On Feb 7, 9:26 pm, kamilski81 wrote:
> I am trying to set a user on a model, on the back-end.
>
> u = request.user
> g = Goal()
> g.user = u
> form = GoalForm(request.POST, g)
>
> I am getting the following error:
> goal.user_id may not be NULL
What was wrong with
3 matches
Mail list logo