Changes between Initial Version and Version 1 of CookBookValidateImageWeight
- Timestamp:
- Feb 24, 2006, 4:26:44 AM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBookValidateImageWeight
v1 v1 1 = CookBook - Validate an image weight = 2 To check the weight an image uploaded via your form, you 3 can implement this method into your view.py or custom manipulator. 4 5 == Code == 6 Here we check that the image under 100 kb. 7 {{{ 8 def isValideSize(field_data, all_data): 9 if len(field_data["content"]) > 100000: # 100,000 bytes 10 raise validators.ValidationError, "File is too large" 11 }}}