Changes between Initial Version and Version 1 of CookBookValidateImageWeight


Ignore:
Timestamp:
Feb 24, 2006, 4:26:44 AM (18 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBookValidateImageWeight

    v1 v1  
     1= CookBook - Validate an image weight =
     2To check the weight an image uploaded via your form, you
     3can implement this method into your view.py or custom manipulator.
     4
     5== Code ==
     6Here we check that the image under 100 kb.
     7{{{
     8def isValideSize(field_data, all_data):
     9        if len(field_data["content"]) > 100000: # 100,000 bytes
     10                raise validators.ValidationError, "File is too large"
     11}}}
Back to Top