Re: Complex form for a newbie with ImageField and ForeignField

2009-07-14 Thread djangonoob
thanks dude! that worked out perfectly for me. On Jul 14, 8:48 pm, Lakshman Prasad wrote: > You could replace in the view: > > if form_upload.is_valid(): >   form_upload.save() > > # with this: > > if form_upload.is_valid(): >   form_upload.user = request.user >   form_upload.save() > > You may

Re: Complex form for a newbie with ImageField and ForeignField

2009-07-14 Thread Lakshman Prasad
You could replace in the view: if form_upload.is_valid(): form_upload.save() # with this: if form_upload.is_valid(): form_upload.user = request.user form_upload.save() You may also want to not display the user field in the form. You can do it by defining an 'exclude' Meta class attribut