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
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
2 matches
Mail list logo