ImageField required=True is_valid always return false

17 views
Skip to first unread message

Moreno

unread,
Jul 22, 2011, 9:48:41 AM7/22/11
to Pinax Users
Hi, everybody.

I've built a simple form to upload three images and that's worked fine
until I changed the field "ImageField" to required=True (I just remove
required=False) after that the "is_valid" test at views.py always
return false.

Any help is welcome.

Thanks.

forms.py
http://chopapp.com/#yxd9prau

views.py
http://chopapp.com/#whyhrwjk

new_photos.html
http://chopapp.com/#gaa61x2o

Moreno Cunha

unread,
Jul 22, 2011, 9:59:31 AM7/22/11
to Pinax Users
views.py update

Moreno Pinheiro
Developer

info={ 
          'Blog' : 'EasyDjango',
          'Twitter' : '@morenocunha',
          'Skype' : 'moreno.pinheiro',
          'tel' :  '+55 27 9834-6305' 
       }



2011/7/22 Moreno <mp3c...@gmail.com>

Patrick Altman

unread,
Jul 22, 2011, 5:57:43 PM7/22/11
to pinax...@googlegroups.com
Why are you doing: "if not form.is_valid():" instead of "if form.is_valid()"?

> --
> You received this message because you are subscribed to the Google Groups "Pinax Users" group.
> To post to this group, send email to pinax...@googlegroups.com.
> To unsubscribe from this group, send email to pinax-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pinax-users?hl=en.
>

Moreno

unread,
Jul 24, 2011, 10:59:36 AM7/24/11
to Pinax Users
The problem was at "request.user" in "form=FotosForm(request.user,
request.POST, request.FILES)" after removed it worked fine. :)

Thanks.
Reply all
Reply to author
Forward
0 new messages