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
esendet: Montag, 14. Februar 2011 14:22
An: django-users@googlegroups.com
Betreff: Re: AW: Form to add data
How hard are you looking?
http://docs.djangoproject.com/en/1.2/topics/forms/
This page shows a clear example of how to use forms in general
http://docs.djangoproject.com/en/1.2/topics/for
On Mon, Feb 14, 2011 at 1:19 PM, Szabo, Patrick (LNG-VIE)
wrote:
> I swear I'm reading the documentaion but i really can't find those
> information.
How hard are you looking?
http://docs.djangoproject.com/en/1.2/topics/forms/
This page shows a clear example of how to use forms in general
http
ango-users@googlegroups.com [mailto:django-users@googlegroups.com] Im
Auftrag von Michael
Gesendet: Montag, 14. Februar 2011 14:08
An: django-users@googlegroups.com
Betreff: Re: AW: Form to add data
You have to import AuthorForm into your views.py
from models import AuthorForm
--
You received this messa
You have to import AuthorForm into your views.py
from models import AuthorForm
--
Michael
On Mon, 2011-02-14 at 13:53 +0100, Szabo, Patrick (LNG-VIE) wrote:
> Thanks, that is exactly what I've been reading for the past hours but i can't
> make it work.
>
> >From what i understand:
>
> I do
Thanks, that is exactly what I've been reading for the past hours but i can't
make it work.
>From what i understand:
I do this in my models.py
class AuthorForm(ModelForm):
class Meta:
model = Author
Where do i have to put this to
f = AuthorForm(request.POST)
?!
My guess was in
7 matches
Mail list logo