On Monday, February 14, 2011 1:59:08 PM UTC, Szabo, Patrick (LNG-VIE) wrote:
>
>
>
Now i did exclude certain fields in my form because i have to set them
> automaticaly.
> Eg. I have a field that's called Mitarbeiter. I want to set the field to
> the current user id so i've tried this:
>
> def
> def main(request):
> f = BuchungForm(request.POST)
> buchung = f.save(commit=False)
> buchung.Mitarbeiter = 'request.user.id'
> buchung.save()
> return render_to_response('main/index.html', {'user' : request.user,
> 'form' : f})
>
> but this gives me the following erro
okay your first linked helped me...thank you !
I guess the documentaion is just too fragmented for me.
So now my view looks like this:
def main(request):
f = BuchungForm(request.POST)
return render_to_response('main/index.html', {'user' : request.user, 'form'
: f})
and my template look
Ahh stupid mistake...okay no error anymore.
But i still dont see any field in my view :-(
How do show the form ?!
I guess i have to pass the form onto the template and then reference to it in
the template ?!
If so, how do I do that ?!
I swear I'm reading the documentaion but i really can't find
4 matches
Mail list logo