Re: setting a form to invalid after having called form.is_valid()

2008-08-27 Thread Berco Beute
Thanks, that works great! I didn't know about 'from django.core.files.images import get_image_dimensions'. Where can I find documentation about that? I've tried a custom 'clean_image' before using PIL, but that was just plain ugly. I never knew about 'get_image_dimensions'. 2B > It's much simpl

Re: setting a form to invalid after having called form.is_valid()

2008-08-27 Thread James Matthews
Whoops I pressed send too soon. In your forms code create a method called clean_imageForm and add your custom error code there. On Wed, Aug 27, 2008 at 1:33 PM, James Matthews <[EMAIL PROTECTED]> wrote: > In your forum code you can add the clean_imageForm and add your cleaning > code in there. >

Re: setting a form to invalid after having called form.is_valid()

2008-08-27 Thread James Matthews
In your forum code you can add the clean_imageForm and add your cleaning code in there. On Wed, Aug 27, 2008 at 11:39 AM, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > Hi, > >> I have an image upload form and I want to INvalidate the form if the >> uploaded image it too big. How can I get an error

Re: setting a form to invalid after having called form.is_valid()

2008-08-27 Thread Rajesh Dhawan
Hi, > I have an image upload form and I want to INvalidate the form if the > uploaded image it too big. How can I get an error message in the form > saying the uploaded image is too big? > > ===Model== > class Image(models.Model): > image = models.ImageField(upload_to='imageu

setting a form to invalid after having called form.is_valid()

2008-08-27 Thread Berco Beute
I have an image upload form and I want to INvalidate the form if the uploaded image it too big. How can I get an error message in the form saying the uploaded image is too big? ===Model== class Image(models.Model): image = models.ImageField(upload_to='imageupload') ===View==