Changes between Initial Version and Version 1 of CookBookValidateWeight


Ignore:
Timestamp:
Feb 24, 2006, 4:23:03 AM (19 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBookValidateWeight

    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