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===================
if imageForm.is_valid():
    inst = imageForm.save(commit=False)
    if inst.image.width > 640:
        #TODO: set the error message of this form to 'image is too
big'
=========================


Thanks,
2B
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to