On Feb 6, 10:11 pm, kamilski81 wrote:
> No I am not, once the user is logged in I just want to pull the user
> from there...sort of like this
>
> if request.method == 'POST':
> instance = request.user
> goal = Goal(user=instance)
> form =
No I am not, once the user is logged in I just want to pull the user
from there...sort of like this
if request.method == 'POST':
instance = request.user
goal = Goal(user=instance)
form = GoalForm(request.POST, goal)
if form.is_valid():
form.save()
On Feb 6, 7:00 pm, kamilski81 wrote:
> Basically I am doing the following:
>
> u=User.objects.get(username="kamilski81")
> goal = Goal(user=u)
> form = GoalForm(request.POST, goal)
>
> and get this error:
>
> (1048, "Column 'user_id' cannot be null")
>
> FROM THE
Basically I am doing the following:
u=User.objects.get(username="kamilski81")
goal = Goal(user=u)
form = GoalForm(request.POST, goal)
and get this error:
(1048, "Column 'user_id' cannot be null")
FROM THE front-end...
Kamil
On Feb 5, 10:43 pm, Dylan Evans
It pulls the User correctly, and there is an object there...but it
won't let me store it on the front-end form, cause user_id is not set
or something of that sort.
On Feb 5, 10:43 pm, Dylan Evans wrote:
> user = User.objects.get(username__exact='bob')
> Works fine for
user = User.objects.get(username__exact='bob')
Works fine for me, you may want to try get since it will throw an exception
if there is no matching user. Then you know the problem is elsewhere.
On Sat, Feb 6, 2010 at 11:30 AM, kamilski81 wrote:
> I would like to save a form
6 matches
Mail list logo