forms.ImageField.clean should annotate the object returned by FileField.clean
|Reported by:||jdunck||Owned by:||petraszd|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ImageField.clean does some validation that the given file is, in fact, an image, but then just returns whatever the FileField gave it-- generally an UploadedFile.
I have a later Form.clean_* method which needs to do further work with the image, and so uses Image.open again.
I think it'd be good to annotate the UploadedFile with an image attribute to save the work of parsing the image yet again.
f.image = trial_image
Change History (14)
comment:9 Changed 14 months ago by petraszd
- Owner changed from nobody to petraszd
- Status changed from new to assigned